NEF (Nikon RAW format)

NEF includes an embedded, full size, jpeg copy. Roughly equivalent to exporting using the “basic” (lower quality setting, 85% jpeg-quality). This jpeg contains no metadata though (it could be re-injected from the source NEF).

According to this blog post D200 produce exactly the same images (basic conversion vs embedded); my tests on a D60 show some difference (e.g. the image is slightly cropped).

Useful commands

Extraction of embedded jpg:

$ exiftool -b -JpgFromRaw image.nef > image.jpg

Copy of exif data:

$ exiftool -TagsFromFile source.nef target.jpg


$ exiv2 ex -e e source.nef # Extraction *
$ mv source.exv target.exv # Names must match
$ exiv2 in -i e target.jpg # Injection
  • Also:
    $ exiftool -exif -b source.nef > target.exv

Comparison of images:

$ compare -metric MSE source1.jpg source2.jpg diff.png

Also useful metric: PSNR

Maker-specific extra detailed information (Lens model, shutter count, focus mode…):

$ exiftool -nikon FILE.NEF|FILE.JPG

Extraction of ICC profile (In-camera files don't include them, at least on the D60; RAW processing software usually does embed them):

$ exiftool -icc_profile -b FILE.JPG > profile.icc

Insertion of ICC profile (Required for embedded JPGs shot in AdobeRGB –Nikon's color mode II–):

$ exiftool '-ICC_Profile<=InputFile.icc' FILE.JPG


  • 2009-07-10: Added exiftool's -exif, -TagsFromFile, -nikon and -icc_profile
  • 2009-06-19: Initial version

Useful references

Last update: July 10th 2009

photo/nef.txt · Last modified: 2010/02/17 01:57 by Toni Corvera
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki