Alley in Pisa, Italy

by Lars Kotthoff

submit your photo

Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

I read a few articles about lossy DNG, and here is a very technical thread for example:

I get what lossy means, but the other important aspect is that it's 8 bit, but they say that it is scene-referred (as opposed to output-referred) and linear, which is supposed to mean that it's dynamic range is the same as the original. Can somebody please explain the differences? I don't even understand what these -referred adjectives mean. Does it mean that a 0,0,0 black/255,255,255 white in a lossy 8-bit DNG is not the same as a 0,0,0 black/255,255,255 white in a standard 8-bit JPEG? What is the visual difference between clipping a 12-bit dynamic range vs compressing it to 8-bit? Where does linearity come into play?

share|improve this question

2 Answers 2

up vote -1 down vote accepted

Does it mean that a 0,0,0 black/255,255,255 white in a lossy 8-bit DNG is not the same as a 0,0,0 black/255,255,255 white in a standard 8-bit JPEG?

Being 'scene referred' means it's the output from the sensor essentially without processing. It's similar to having a JPEG of the image you'd get if all the in-camera options (like conversion to a colour spaces like sRGB and all the in-camera tonal adjustments) were disabled or if there was a native colour space for your sensor. But the compression scheme is just standard JPEG, not even anything particularly clever like JPEG2000 or JPEG XR.

What is the visual difference between clipping a 12-bit dynamic range vs compressing it to 8-bit?

Virtually none, either way you're still losing 4 stops of colour definition. But since most output media (certainly most screens) won't be able to represent all that definition you won't see much. The difference you'll see will be when you decide to try to pull more information out of highlights and shadows since it will have been removed.

Where does linearity come into play?

That comes down to which gamma curve they've decided to apply. A linear representation essentially means gamma 1.0 (so, no curve at all.) It's another way of saying 'whatever value the sensor measured'.

share|improve this answer

When outputting a standard JPEG, the camera tries to adjust for what it thinks will look good for the image output. It may not use the full real-world dynamic range that the camera can read, so values may be truncated on the ends in output-referred, making it so that two values that were previously not both full white or full black become full white or full black. Scene-referred prevents this by keeping the max black and max white points, but makes the steps bigger for each value. The maximum black and white points are kept proportional to everything else the sensor read, but both still lose the ability to represent the same number of colors.

In many cases, the output-referred may actually produce a better image in the long run since it focuses the color distinctions that matter to the output instead of throwing them away on a purely even fashion.

To illustrate the difference, lets say we have a sequence of numbers:


If we compress them using output compression then perhaps the camera realizes that 1 and 10 are outliers and discards them, so the final output when reducing the color space ends up being something like:


As you can see, the brightest point becomes significantly dimmer since the new value of 1 corresponds to the old value of 4 and the new value of 4 corresponds to the old value of 10, but the differences between the majority of the image are preserved well. If we used scene-referred linear though, we have to preserve the values on the upper and lower ends, so we get something like the following:


We may have preserved that the darkest and brightest parts of the image were significantly brighter and darker, but now the entire middle of the image is the same color because we didn't have sufficient resolution to distinguish the colors that were close together.

When they mention linear, they mean that that is how the colors get mapped. If you had an input like:


and you wanted to capture it as best possible, using a non-linear conversion could allow you to preserve much of the detail in the dark parts but still capture the bright part since there are no moderately bright parts, but the means the loss of color information is uneven across the image. Again, this is good if you know what is important about the image, but if you don't, then it may discard important information. Using a linear curve minimizes the chance of an outlying value getting lost, but it means that detail is lost in areas of higher concentration of color.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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