Friday, June 24, 2011

Leica M9 DNG to Nikon D3x NEF converter

My workflow has been based on Nikon Capture NX2, I do a quick review the pictures out of the camera with Photomechanic, delete all rubbish, adjust with Capture NX, and review the results again with Photomechanic. I just keep the NEFs, and generate jpgs or tiff on demand for particular files. With the non destructive editing of NX, this is all I need.

With the M9 coming into the scene, things are not so simple for me. The M9 writes a minimalistic DNG file with no JPG preview. That makes a fast review of the pictures very difficult, Lightroom needs to render the JPG on the fly, and Photomechanic only reads the available small thumbnail. To circumvent this, I run the Adobe DNG converter to rewrite the DNG with an embedded JPG preview as a first step before browsing the files.

Then I import into Lightroom and do my adjustments, but Lightroom does not update the JPG preview after the edits, so any external viewer will not see the edited file, which is quite inconvenient.

So, to introduce the M9 files into my usual workflow, instead of duplicating workflows, I have written a tool to convert the Leica M9 files into NEFs.


Given a Nikon D3x NEF file (the template), and one file or a  directory containing Leica M9 DNG files, the tool will create  corresponding NEF files where the following are injected from the DNG file:
  • A JPG preview. This is created using dcraw that you need to have in the path.
  • The RAW data
  • Most of the EXIF parameters
  • The white balance values
The rest will be inherited from the template Nikon file, and that includes all proprietary camera settings and Capture NX controls. You can change the settings of the NEF template before running a conversion, and all newly created files will inherit them.

DNG files need to be OUT OF CAMERA v1.162 M9 firmware files and of UNCOMPRESSED RAW data. Your DNG files will never be modified as they are only read, but other versions may, and compressed files indeed will, not result in an usable NEF file.

Enjoy, and comments welcomed!