Nikon's NEF RAW file conversion to Jpeg

I want to extract jpeg image from Nikon's NEF RAW files, if its embedded in it, programmatically in SilverLight. Something similar to what QuickJPGfromCR2 tool does, for Canon RAW files CR2, http://www.gdzid.com/QJFC.cs ; or JPEGSnoop (written in C++) does.

I have seen few URLs but couldnt get to the bottom of where the jpeg image would start in a NEF file, how big is that, how to gather other information about JPeg thumbnail and so on.

Re: Nikon's NEF RAW file conversion to Jpeg

Hi,

Microsoft released codecs to work with raw files natively within the Explorer on Windows 7 to extract JPEG previews as thumbnails. I presume the same functionality could have made its way in to the .Net framework. However SilverLight always drags behind the standalone .Net in functionality so that is a long shot.

I am assuming that you have a way to get the images to SilverLight. It runs in a sandbox with reduced file system functionality. So this means that you will not be able to run an external program to extract the JPEG.

Have you tried posting on a few programmer forums such as StackOverflow? Some kind person may help you out there.

Re: Nikon's NEF RAW file conversion to Jpeg

Originally Posted by Shadowman

You have to convert the NEF file and I believe the default is TIFF format, from their you can save as a jpeg.

There is a full resolution jpeg within a NEF file though it is the "Basic" one as set by the camera so there is a quite a bit of compression. I used to have a bit of software called PreviewExtractor (seems to have disappeared from the net) that would pull them out. It was a handy way of quickly assessing images before Nikon released its NEF Codec for Windows as it would pull them out at a rate of three or four a second.

Re: Nikon's NEF RAW file conversion to Jpeg

Originally Posted by black pearl

There is a full resolution jpeg within a NEF file though it is the "Basic" one as set by the camera so there is a quite a bit of compression. I used to have a bit of software called PreviewExtractor (seems to have disappeared from the net) that would pull them out. It was a handy way of quickly assessing images before Nikon released its NEF Codec for Windows as it would pull them out at a rate of three or four a second.

Sorry I don't know anything about programming but the jpeg is there.

I usually set my camera to RAW +B (NEF +JPEG Basic). I only use the JPEG for viewing which files I plan to process and to get an idea how they look through the viewfinder (highlights, histogram, etc.). The JPEG Basic uses the highest compression setting and I rarely edit these images.

Re: Nikon's NEF RAW file conversion to Jpeg

Well I'm learning here today...I've never heard of a RAW file 'containing' a JPEG file (As usual I must have been sleeping at the back of the class in that lesson...)

I've always understood that RAW files need to be converted. The image we see on the rear screen of the camera is just a quick and dirty conversion of the RAW file stored on the memory card. To me RAW files were simply sensor-output files which then had to be 'treated'.

I've always understood that RAW files need to be converted. The image we see on the rear screen of the camera is just a quick and dirty conversion of the RAW file stored on the memory card. To me RAW files were simply sensor-output files which then had to be 'treated'.

Confirmation anyone please?

A RAW file contains two images - the first is basically a "sensor dump", the second is the jpeg preview that the camera generates.

Re: Nikon's NEF RAW file conversion to Jpeg

Originally Posted by Colin Southern

A RAW file contains two images - the first is basically a "sensor dump", the second is the jpeg preview that the camera generates.

Going off topic here but I wonder if that explains something I've noticed when I connect my Canon 400D to my XPMCE system. The camera is set to capture RAW+JPG so when I first connected it to the PC I expected the CF card to appear in Explorer as just another drive letter an on which I would see the folder structure ending is a list of .cr2 & .jpgs files. However, XP doesn't handle the CF card inside the camera that way. It does display a file listing BUT not of the a navigable folder structure ending in a list of .cr2 and .jpg files. What I see is just a listing of files as TWO .jpgs for every file and no .cr2 files. I can understand the 'missing' .cr2 files, XP has no native viewer for them and so the camera wizard can't cope with them. What I could understand (until now) was why I saw two versions of the .jpg file.

Re: Nikon's NEF RAW file conversion to Jpeg

Originally Posted by stuck

Going off topic here but I wonder if that explains something I've noticed when I connect my Canon 400D to my XPMCE system. The camera is set to capture RAW+JPG so when I first connected it to the PC I expected the CF card to appear in Explorer as just another drive letter an on which I would see the folder structure ending is a list of .cr2 & .jpgs files. However, XP doesn't handle the CF card inside the camera that way. It does display a file listing BUT not of the a navigable folder structure ending in a list of .cr2 and .jpg files. What I see is just a listing of files as TWO .jpgs for every file and no .cr2 files. I can understand the 'missing' .cr2 files, XP has no native viewer for them and so the camera wizard can't cope with them. What I could understand (until now) was why I saw two versions of the .jpg file.

I've seen this behaviour - but it was about 150 years ago, and I can't remember what the solution was. Probably just a codec needed for windows.

If you convert your *.CR2 files to *.DNG you can specify the size of the embedded JPEG, if that helps.

Re: Nikon's NEF RAW file conversion to Jpeg

I've seen this behaviour - but it was about 150 years ago, and I can't remember what the solution was. Probably just a codec needed for windows.

If you convert your *.CR2 files to *.DNG you can specify the size of the embedded JPEG, if that helps.

Only 150 years ago? It's not a problem for me though. If I take the CF card out of the camera and put it into a card reader XP reads it 'properly' and I see the full folder structure and all the .cr2 and matching .jpgs.

XP doesn't natively generate a thumbnail for the .cr2s but I have read that it is possible to get XP to display .cr2 files as thumbnails. However, I've never bothered to fix this issue. I find it quite handy really since it means I don't see double.