V1.02
Thom Hogan’s Complete Guide to the Nikon D300
Page 160
In the visually lossless version (
Compressed NEF
) you get
some of the original data back (in the shadows and some mid-
tones), but the highlights are posterized in a way that is
consistent with human vision’s capabilities. We
do
need to
discuss how this works, as it can produce visual effects in
your images.
I’m not sure I’d term the methodology Nikon uses for the
visually lossless format as “compression,” but here’s how it
works: when photosite data comes off the ADC, it has 12 or
14 bits of value to it. Let’s use 12-bits to keep things simple. A
12-bit value from the ADC of 0 would represent “no data”
(black), a value of 4095 would represent “saturation” (white).
If that was the way we stored the data, we’d need 12 bits to
store each photosite’s data. In order to reduce storage size,
the D300 (and other Nikon DSLR bodies) includes a special
method of “compressing” NEF data (
Compressed NEF
set
via the D300 SHOOTING menu) which works as follows:
• Shadow and low mid-range values are passed on as is.
• High mid-range and highlights values are split into groups
(essentially, neighboring values are rounded to a central
value; for example values of 1023, 1024, and 1025 might
all be grouped together and stored as a single value). The
manner in which this is done isn’t linear. The last possible
group value (almost white) has more adjacent values in its
group than the first. This non-linearity is designed to
correspond to the way our eye is able to distinguish
between bright tones.
Thus, there are significantly fewer than 4096 values possible
in this scheme for 12-bit data and significantly less than
16384 values for 14-bit data. The resulting “compressed data”
is further compressed using a somewhat traditional method
that looks at adjacent differences and is truly lossless; the final
data is also packed across byte boundaries for space
efficiency. The result is that the 12 bits of original data stores
in about 6 bits (and 14 bits of original data stores in about 7
bits).