Nikon RAW Codec

Updated note to users of the Nikon RAW Codec for Windows:  Microsoft has received reports of compatibility issues with Nikon NEF files after installing version 1.0 of Nikon’s RAW codec posted in January 2007.  Tagging the RAW files through Windows Vista or the Microsoft Photo Info tool after the codec is installed appears to cause these files to become unreadable in other applications, such as Adobe Photoshop. We have confirmed that these files can still be opened with Nikon Capture.
Nikon and Microsoft have investigated the issue, and have determined that no data is lost, nor is the image file damaged in any way. Nikon is working on an updated codec that will resolve this issue, and expects to have it released in the very near future.
Tagging the file using Photo Info without the Nikon NEF codec installed appears to be safe.

– pixblog

Comments (9)

  1. craigkitterman says:

    Actually got the update dialog in gallery today, but when I followed all the links to Nikon, the page was empty and said the download was not yet available.

  2. vbclown says:

    Good news… it looks like Nikon has issued the patch to fix tagging of NEF’s in Vista.

  3. richardlawler says:

    >  Good news… it looks like Nikon has issued the patch to fix tagging of NEF’s in Vista.


    Files modified by Nikon’s new 1.01 NEF codec are still broken for me in Photoshop Bridge CS2.


    Open D70 NEF file in Vista’s Windows Photo Gallery. Add a tag. NEF is no longer properly displayed by Photoshop Bridge CS2 v. 1.04. Opening with Adobe Camera RAW 3.2 or 3.7 works OK.

    OK in Adobe Lightroom 1.0.

    OK in Photoshop Bridge CS3 Beta 2.

    OK in Photoshop CS3 Beta (ACR 4.0×168).

  4. pquirk says:

    I’ve installed this Codec without installation errors on Windows XP SP2. I have a small C# program that converts image files to compressed TIFF. When the program creates a bitmap from the Nikon .NEF file, the bitmap dimensions are very wrong.

    First, the code …

    using System;

    using System.Windows.Forms;

    using System.Drawing;

    using System.Drawing.Imaging;

    class Example_SetJPEGQuality


       public static void Main(string[] args)


           for (int i = 0; i < args.Length; i++)


               Bitmap myBitmap;

               ImageCodecInfo myImageCodecInfo;

               Encoder myEncoder;

               EncoderParameter myEncoderParameter;

               EncoderParameters myEncoderParameters;

               // MessageBox.Show("Number of args =" + args.Length);

               // MessageBox.Show("First arg is " + args[0]);

               string filename = args[i];

               string TiffFilename = filename.Substring(0, filename.LastIndexOf(".")) + "_lzw.tiff";

               string ext = filename.Substring(filename.LastIndexOf(".") + 1);

               if (!ext.ToLower().Equals("tiff"))


                   // Create a Bitmap object based on a BMP file.

                   myBitmap = new Bitmap(filename);

                   // Get an ImageCodecInfo object that represents the TIFF codec.

                   myImageCodecInfo = GetEncoderInfo("image/tiff");

                   // Create an Encoder object based on the GUID

                   // for the Quality parameter category.

                   myEncoder = Encoder.Compression;

                   // Create an EncoderParameters object.

                   // An EncoderParameters object has an array of EncoderParameter

                   // objects. In this case, there are two

                   // EncoderParameter object in the array.

                   myEncoderParameters = new EncoderParameters(2);

                   // Save the bitmap as a TIFF file with LZW compression.

                   myEncoderParameter = new EncoderParameter(myEncoder, (long)EncoderValue.CompressionLZW);

                   myEncoderParameters.Param[0] = myEncoderParameter;

                   // Save the bitmap as a TIFF file with 24bit color.

                   myEncoder = Encoder.ColorDepth;

                   myEncoderParameter = new EncoderParameter(myEncoder, 24L);

                   myEncoderParameters.Param[1] = myEncoderParameter;

                   myBitmap.Save(TiffFilename, myImageCodecInfo, myEncoderParameters);




                   MessageBox.Show("Invalid file type – must not be .TIFF");




       private static ImageCodecInfo GetEncoderInfo(String mimeType)


           int j;

           ImageCodecInfo[] encoders;

           encoders = ImageCodecInfo.GetImageEncoders();

           for (j = 0; j < encoders.Length; ++j)


               if (encoders[j].MimeType == mimeType)

                   return encoders[j];


           return null;



    This program is run against the file DSCN0001.NEF whose dimensions are 2576 x 1924 according the the Windows Photo Viewer, yet the variable myBitmap receives an image whose dimensions are 160 x 120.

    Anyone else see this?

    — Peter

  5. Nikon has posted an updated version of its RAW codec for Windows Vista. Nikon and Microsoft had received

  6. Photography says:

    Hi pquirk !

    I’ve tried your program, but it didn’t work at me.

  7. Photography says:

    OK I see the problem, it’s work!

  8. djaymore says:

    pQuirk – I have noticed the same problem while trying to read nef files into the bitmap object.  Did you find a solution to this problem?  I am also trying to read the meta data from the file but without success.