I have one NEF file that's showing perfectly fine in ViewNX-i but that displays blue or green color banding at the bottom of the image with every other tool I throw at it (MacOS X Sierra 10.12.4 Preview, DxO OpticsPro 11, RawTherapee, DarkTable). Apparently even LightRoom/PhotoShop can't open the file without displaying banding at the bottom (confirmed by DxO support).

So I suppose it's either a bit error in the RAW data stream or a data encoding mode not (yet / correctly) supported by popular NEF decoding libraries.

The main issue is that I can't use the file in my preferred workflow application (DxO OpticsPro) or in any of its acceptable substitutes (LightRoom/PhotoShop, DarkTable, RawTherapee).

The source file can be downloaded from here.

Knowing that ViewNX-i can display the image without errors, is there a way I could 'repair' this RAW file? So far I could not find a means in ViewNX-i to re-encode the RAW file. Neither did ViewNX-i let me know if there was an actual error in the file.

This question differs from other similar questions (e.g. How to repair demaged .nef files?) since at least one tool is able to correctly render the image.

  • \$\begingroup\$ What happens if you export it from ViewNX as a tiff? tbh, that's my preferred method anyway, stops photoshop's camera raw from messing up the colour & you can still edit most RAW parameters from a tiff in Photoshop. \$\endgroup\$
    – Tetsujin
    Apr 24, 2017 at 10:01
  • \$\begingroup\$ Exporting the NEF file to TIFF in ViewNX-i apparently also displays (greenish) banding. So the decoding error is only corrected while viewing a NEF file in ViewNX-i. \$\endgroup\$ Apr 24, 2017 at 10:21
  • 3
    \$\begingroup\$ At a pure guess, it may only be showing you the uncorrupted jpg then. \$\endgroup\$
    – Tetsujin
    Apr 24, 2017 at 10:22
  • 1
    \$\begingroup\$ A NEF contains a jpg, even if you don't tell the camera to save both. Try something like File Juicer to split it out, or attempt conversion to other types. \$\endgroup\$
    – Tetsujin
    Apr 24, 2017 at 12:50
  • 1
    \$\begingroup\$ I fixed the download link. Meanwhile I used ExifTool to analyze the contents of the NEF file. It appears that I was wrong - there was a full-size JPEG image embedded in the NEF file (along with a smaller preview version). So it could mean that ViewNX-i only displayed the embedded JPEG image, without even caring to show the raw data. \$\endgroup\$ Apr 24, 2017 at 15:17

1 Answer 1


Upon inspection with the free command-line ExifTool it appears that the image I referred to in the question contains a valid full-size JPEG image as well as a corrupt RAW image. The JPEG image was extracted as follows from the NEF file:

$ exiftool -b -JpgFromRaw -w _jpeg_from_raw.jpg -r DSC_5037.NEF
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - DSC_5037 (PC).NEF
    1 output files created

It appears that some image viewers - apparently also Nikon ViewNX-i - don't bother decoding the RAW image data when rendering the images on a display. This gives the impression that they can heal the otherwise corrupt RAW image data. When such tools perform image conversion operations, they however touch the RAW image data, hence their output renders the image corruption artifacts.

So unless there's a smart RAW image data editor (bitwise stream editor) I don't think it is possible to fix such errors.

It however makes the case for adding error correction bits into the RAW stream one day.

  • 1
    \$\begingroup\$ ViewNX-i does render raw if you ask it too, if you look you'll see a "RAW" button to make that happen. \$\endgroup\$
    – Linwood
    Apr 24, 2017 at 20:41
  • \$\begingroup\$ Apparently, but not by default. On OSX the "RAW" button appears at the top left of the ViewNX-i frame. \$\endgroup\$ Apr 25, 2017 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.