Saturday, May 19, 2012

DNG2NEF v3.0, more cameras supported, and a little fun with the M monochrom

DNG2NEF v3 adds support for more Leica cameras, in particular the M8,
M9 Monochrom and the S2.

Note: you need to have either Capture or View NX installed on the computer
where you plan to run DNG2NEF, otherwise the Nikon SDK libraries cannot 
be loaded.

Some notes, caveats and findings:


Leica M8

The M8 stores the raw in 8 bits per pixel, that need to be linearised
(expanded) to 14 bits to conform a valid NEF, so expect a size
increase when transforming your M8 files to NEF.

M8 sample files available at


Leica S2

Sample files are available at
No caveats with this model. I have not tested the latest camera firmware, should work fine.


M9 Monochrom

Sample files, thanks to Jonathan Slack, at
This is included only for fun and curious minds. Being the MM a
monochrome sensor, each pixel from this DNG files represents a grey
value, from black to white. The Bayer array of the color cameras, NEF
included, dedicate each pixel to read only Red, Green or Blue
values. For a better understanding, see the following diagram and
explanations, taken from the Leica website,

"With a full native resolution of 18 megapixels, the Leica M Monochrom
delivers 100% sharper images than with colour sensors. As its sensor
does not see colours, every pixel records true luminance values - as a
result, it delivers a true black-and-white image. The combination of
the brilliant imaging qualities of Leica M-Lenses and the image sensor
results in images with outstanding sharpness and natural brilliance. (sic)"

DNG2NEF does a raw copy of the binary sensor reading from the DNG to 
the NEF file. When doing this with a M9 Monochrom file, the result does
not need to have any sense, since we are attributing values to the RGB
pixels that come from monochrome readings. When Capture NX, or any RAW
developer program, reads this NEF, it will assume that it is a colour
picture and will proceed to the demosaicing and colour processing. What
weird colours is that rendering going to provide? Apples treated as

This is a jpg out from the DNG, Adobe Camera Raw and Photoshop CS5:

This is a jpg out from the aberrant NEF file with Capture NX.

Seems to be nice, how can it be? Is not that the real image?

We need to look at the histogram. In a B/W RGB image, the three
colours will show exactly the same histogram, as their common value
implies a combined grey value.

If we look at the RGB histogram of the MM/NEF file, we can see that it
is almost identical for the three channels:

My take? Since the MM pixel sensors are so close, and they read the
same spectrum, the reading of adjacent pixels is mostly the same in a
normal image, so when copied to the RGB NEF file, they are almost a
legit RGB monochrome file with the red/green/blue values nearly
identical, and then providing a credible picture. 

If we look the NEF at 100% in Capture NX, and the DNG as open in CS 5,
I can see a sharpness advantage to the DNG, on the pixel level, but
probably nothing spectacular if you look to the complete picture.

This curious rendering I think is just the effect of oversampling, so adjacent
monochrome pixels just happen to take the same reading.

The real value of such monochrome oversampling in normal pictures is what is
for me under question. If you want to measure the colour in a given point, there
you have all these tricks like the Bayer array, but to digitalize a B/W image is
much less demanding.

I have found some traces of colour in MM NEF files, see the DNG files
provided here,

Where there are high frequency and contrast areas, I can see a trace of colour,
which means that the adjacent monochrome pixels do not have the same value,
for example in the earrings of this lady. The first crop comes from the B/W tiff
out of the DNG, the second from the NEF. You really need a good sight to
perceive these colours.

Which camera can give you better B/W pictures, the M9, or the M9
monochrom? The MM will be a little sharper, and have better high ISO,
but the colour information carried on the M9 RGB Bayer array seems not
to fall 100% behind in sharpness, and will provide colour masking and
selection for better post-processing. En theory, a monochrome sensor may
be a good idea, but in practice I think it does not bring sufficient advantage
over a Bayer sensor of the same resolution.

Try for your self, and enjoy.

Thursday, May 3, 2012

a faster DNG2NEF

Last 4th of April, Nikon released their NEF SDK with support for
64bits, after their NX2 upgrade. Based on these libraries, and also
doing some further refinements, I am releasing a new and faster
DNG2NEF, version 2.64, for both Windows 7 64bit and Mac OSX Lion 10.7.

This version supports firmware 1.162, 1.174 and 1.176 of the M9, and
both versions 1.0 and 2.0 of the X1. It is a 64bit executable, and
twice as fast as the previous 32bit version.

There are a few parameters that you can modify when processing the
files. These are the "Conversion settings":
  • Skip existing, so no NEF with the same filename is rewritten if found at the target directory.
  • Strict Compat., controls the compatibility check of the camera firmware version. In case of a camera firmware update, DNG2NEF may still work, so leave this to "NO", and see what happens.
  • Color space, to set the desired color space for the NEF.
  • JPG divider, can divide the JPG preview by this factor, leading to slightly smaller files.
  • JPG quality, to determine the compression quality.