Wednesday, August 26, 2009

Raw ( nef ) image conversion

I recently acquired a set of photos from a high end Nikon digital camera, which were in the .nef file format.

I stumbled around the web for a while, looking for a good way to convert the entire set into a format usable to mere mortals... and found an amazing lack of simple tutorials of how to do it - probably because it turned out to be simpler than I expected.

Here is the deal.

UFRaw will convert these images for you to PNG, JPG, and a few other common formats.

For example, to convert all .nef files in a folder into PNGs:

ufraw-batch --out-type png16 --exif *.nef

Or Jpegs:

ufraw-batch --out-type jpeg --exif *.nef

However, I did run into a snag here - that may very well be specific to the camera that the pics came from. For some reason, I'm ending up with 10 rows of corrupt pixels at the top of each and every image. So, I needed to crop every image by 10 pixels. ufraw didn't appear to be able to do that.

So, then I tried ImageMagick (which actually uses ufraw internally to convert the raw images into something it can read) - it can do all sorts of editing while processing images.

Here is the ImageMagick command I used to convert .nef files to Jpg - and chop 10 pixels off the top of the images along the way:

mogrify -path output/ -quality 100 -chop 0x10 -format jpg *.nef

Alas - another snag. ImageMagick loses the EXIF data for the picture while doing this conversion. I reported that issue - and it was acknowledged and FIXED in less than 1 day.

However, I used this two step alternative to convert the raw files, chop off 10 pixels, and maintain the EXIF data, since I didn't have the fixed version yet:

ufraw-batch --out-type png16 --exif *.nef
mogrify -path . -quality 100 -chop 0x10 -format jpg *.png

Comments: Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home

Subscribe to Posts [Atom]