Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I accidentally set my camera (a Nikon D70) to shoot in NEF only and not NEF+JPEG.

Obviously, this will be a major pain when I want to go through them all. I don't envy having to wait for seconds at a time for a single picture to render.

Is there any way I can batch convert the whole set (thousands of pictures) to JPEGs?

I am running Windows 7 and Xubuntu 12.04.

share|improve this question
You probably got a copy of View NX2 (you can download from the Nikon site) with your camera - that will batch convert and do it in a similar way to in camera conversion –  BJ292 Apr 20 '13 at 17:51

4 Answers 4

up vote 7 down vote accepted

Another great free tool is IrfanView that when combined with plugins can Batch convert from almost any format to JPG.

Q: Can I use IrfanView on Linux?

A: Yes. There is no native-Linux version of IrfanView. However, you can use IrfanView in conjunction with Linux programs like WINE, Windows Linux emulators and Linux-based virtual machines. Take the ZIP version of IrfanView and unzip it or copy your existing Windows IrfanView folder to Linux. This is easier because the installer may need additional Windows DLLs to run.

If you want a software that is more OS independent then I would recommend UFRaw. Use it either on its own or in conjunction with Gimp

share|improve this answer
I think this is a better solution then mine, IrfanView can do a lot more than these conversions. –  galuano1 Apr 4 '13 at 0:43
Well, that's up to OP to judge :) –  Darius Apr 4 '13 at 0:44

One solution, on Ubuntu, would be to use dcraw to convert NEF to PBM, and pnmtopng to convert PBM to png. So, open a terminal and run these commands:

sudo apt-get install netpbm dcraw

I don't have any .NEF images to test this, but according to this page, you can do:

Convert all NEF images to PNG:

dcraw -c -w input.NEF | pnmtopng > output.png

To convert an entire directory:

for filename in *.NEF ; do dcraw -c -w "$filename" | pnmtopng > "$filename.png" ; done

Probably the best tool around for all your batch image processing needs, however, is ImageMagick. It's free, open source, cross platform and can do just about everything you can think of including resizing, cropping, managing transparancy, montage and converting between most image formats under the sun. It would have been my first choice, but I found some (older) posts claiming that it did not work with NEF. Still, their website says it does, so you should try it out and in any case, it is really worth learning. Install it on Ubuntu with:

sudo apt-get install imagemagick

To convert a single .NEF:

convert foo.NEF foo.jpg

To convert all .NEF files in the current directory (will overwrite the originals):

mogrify -format jpg *.NEF

To do the same but keeping the original files, run convert in a loop:

for img in *.NEG; do convert "$img" "$img.jpg"; done
share|improve this answer
You might need to install ufraw-batch first. (I had to sudo apt-get install ufraw-batch to make mogrify work) –  Clash Sep 26 '13 at 19:42
Oh and mogrify -format jpg *.NEF does not overwrite the originals –  Clash Sep 26 '13 at 19:50
This is great! If I want to run "mogrify -format jpg *.NEF" also for NEFs in subdirectories, how would the bash script look like? Thanks. –  Regmi Oct 19 '13 at 22:56
@Regmi try find . -name "*.NEF" -exec mogrify -format jpg {} +. –  terdon Oct 21 '13 at 14:26
@terdon Thank you. –  Regmi Oct 22 '13 at 5:15

If you do end up using ImageMagick, then I recommend using xargs if you've actually got thousands of images to convert rather than using a for loop. That way, you can easily bump up the parallelism:

# Runs these conversions serially
ls *.NEF | sed 's#.NEF##' | xargs -I^ convert ^.NEF ^.jpg

# Runs these conversions with 8 different processes
ls *.NEF | sed 's#.NEF##' | xargs -P8 -I^ convert ^.NEF ^.jpg
share|improve this answer

You can use NEFtoJPG. Its free and can do batch processing.

share|improve this answer

protected by DragonLord May 8 at 18:29

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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