Compressed raw files and exposure strategy

Iliah Borg

Forum Pro
Messages
28,064
Solutions
26
Reaction score
26,453
Location
AK, US
On the graph below you can see how values from NEX-7 raw file are translated to linear values. Other NEX and SLT cameras are similar. The graph is in lin-log, that is "X" axis is linear file raw levels; while the "Y" axis is log(decoded linear levels). That helps better reading of level values from the "X" axis and to make stops go evenly. Blue horizontal lines mark the stops.

You can see how many levels camera puts into a raw file for each stop.

Things one may want to think about while examining the graph:
  • do you want to use ETTR, given such a transfer?
  • do you want to set ISO in the camera rather than adjusting brightness during conversion?
  • is correct exposure with such a camera more important than with a camera that offers uncompressed raw?


Decoding goes as following: raw value is multiplied by 2, the camera curve is applied, black level of 128 is subtracted.

--
http://www.libraw.org/
 
Are you basically showing us that bright values are stored more coarsely/imprecisely than dark values?

Also, could you show us an analogous graph from a camera that does not "compress" its raw files? That would help me puzzle out what we should be learning from your graphs. Which by the way are a nice effort for us, and I look forward to interpreting the info correctly.
 
I also know nothing of this, but I'm going to comment anyway.

Imagine a camera that simply counts photons: 1 photon gets a recorded as 1 in the raw file, 100 photons records as 100 in the raw file. This would seem like the ideal way record the amount of light reaching the sensor.

Plot this as a log-linear plot as you have done and it looks like this:





So isn't this curve exactly what you'd expect?

As for ETTR, as I understand it, the idea is to record the image by getting as much light to the sensor as possible, thereby increasing the signal/noise ratio. Surely doing this is desirable, or am I missing something?

--
A rose by any other name is still a chicken.
 
If you compare the graphs to see how many raw levels form the last stop, you will see it is about 300 levels in the Sony compressed raw vs. half of all levels in an uncompressed file. By the number of levels Sony compressed file is optimized towards midtones, and allows little margin, or latitude, for exposure error in the midtones before number of levels recorded in a compressed raw for that region decreases.

--
http://www.libraw.org/
 
If you compare the graphs to see how many raw levels form the last stop, you will see it is about 300 levels in the Sony compressed raw vs. half of all levels in an uncompressed file. By the number of levels Sony compressed file is optimized towards midtones, and allows little margin, or latitude, for exposure error in the midtones before number of levels recorded in a compressed raw for that region decreases.

--
http://www.libraw.org/
Hi Iliah. From a practical perspective what conclusion is your argument and graph suggesting? Your first post cautions the reader to take some precautions but without a technical mastery equivalent to yours the advice doesn't enlighten. Would you clarify a bit more for us?

Thanks, Rich
 
Hi Rich,

From the graph and from the shots I would suggest that the latitude for a good rendition in Zones IV to VI is no more than 1 stop. Means no real room for ETTR, and to use ISO on the camera to control "raw" values up to ISO 800; further ISO bumping does not increase the quality but blows out highlights more than needed. For me, photographically usable dynamic range of the NEX and SLT cameras having this type of compression is limited to 8 1/3 stops all the way to ISO 800. After that it decreases about 1 stop for each ISO stop.

--
http://www.libraw.org/
 
Iliah,

this compression that limit the margin of error during the exposure, is only in Sony cameras? The other cameras like A900/A850, and A700/A580 have the same compression curve?
Are there some differences between the new-5N and the nex-7?
Many thanks.
Saverio
Hi Rich,

From the graph and from the shots I would suggest that the latitude for a good rendition in Zones IV to VI is no more than 1 stop. Means no real room for ETTR, and to use ISO on the camera to control "raw" values up to ISO 800; further ISO bumping does not increase the quality but blows out highlights more than needed. For me, photographically usable dynamic range of the NEX and SLT cameras having this type of compression is limited to 8 1/3 stops all the way to ISO 800. After that it decreases about 1 stop for each ISO stop.

--
http://www.libraw.org/
 
Ideally with your comments on how one could do something differently with that raw format that would differ from recommendations here for Sony raw format.
 
I also know nothing of this, but I'm going to comment anyway.

Imagine a camera that simply counts photons: 1 photon gets a recorded as 1 in the raw file, 100 photons records as 100 in the raw file. This would seem like the ideal way record the amount of light reaching the sensor.
Not really. The reason is that when you count random arrivals of items the number you get varies quite a lot, in fact it varies with a standard deviation equal to the square root of the expected average count. See here:
http://en.wikipedia.org/wiki/Poisson_distribution

In images this Poisson distributed noise is usually called shot noise as it is here:
http://en.wikipedia.org/wiki/Image_noise#Shot_noise

Because of this noise, counting every photon for large counts includes a lot of meaningless variation or noise. So for example if we count with a precision of two counts per standard deviation then we will recover all the information available about the number of arrivals without needlessly including all of the random noise. Experimentally John Sheehy found that if the count spacing was 1.4 counts per standard deviation then you couldn't see any difference to the full precision raw file. Here is a thread where he made a spreadsheet to calculate the spacing of the counts:
http://forums.dpreview.com/forums/read.asp?forum=1018&message=31213821

In a reply to that thread I posted the function for the curve that would result in this spacing. That function is the same as a gamma=2.0 tone curve with the black level shifted according to the square of the read noise standard deviation. So as long as the steps are smaller than the expected shot noise by a factor of 2 (or 1.4 if you aren't too picky) and as long as the compression/decompression doesn't change the expected level (this is the mistake Nikon made with their raw compression implementation) then no information is lost by increasing the spacing for bright tone levels. (This doesn't mean that some of the same information that is in the higher bits can't be replicated in the low bits that will be discarded if non-ideal A-D conversion has occurred: Iliah has shown an example of exactly this case where you can see some of the image data from the high bits when looking at only the lowest bits.)

There is a very good reason Sony uses some raw compression in their Exmor sensors. Those sensors use column parallel ramp type A-D converters. The conversion speed of this type of converter is proportional to the number of steps of the ramp. By scaling the ramp the way Iliah plotted Sony can get enough precision for the nearly black pixels at the beginning of the ramp without having to wait for the ramp to go though 16000 steps to reach the level for the highest levels. So this explains how Sony implements the level compression: they progressively change the ramp step size at the counter in the ramp generator of the A-D converter.

Since no information is lost you should use the exact same exposure rules as for a camera that counts every single photon. So, for setting gain during post processing vs using analog ISO, and for exposing all the way to the right without clipping etc, it makes no difference if a correct raw level compression as I just described it has been used.
 
Since no information is lost you should use the exact same exposure rules as for a camera that counts every single photon. So, for setting gain during post processing vs using analog ISO, and for exposing all the way to the right without clipping etc, it makes no difference if a correct raw level compression as I just described it has been used.
Try to test the above.

--
http://www.libraw.org/
 
Since no information is lost you should use the exact same exposure rules as for a camera that counts every single photon. So, for setting gain during post processing vs using analog ISO, and for exposing all the way to the right without clipping etc, it makes no difference if a correct raw level compression as I just described it has been used.
Try to test the above.
The fact no information is lost with proper raw level compression has already been tested by John Sheehy.
 
Since no information is lost you should use the exact same exposure rules as for a camera that counts every single photon. So, for setting gain during post processing vs using analog ISO, and for exposing all the way to the right without clipping etc, it makes no difference if a correct raw level compression as I just described it has been used.
Try to test the above.
The fact no information is lost with proper raw level compression has already been tested by John Sheehy.
So, given the start is two "normal" linear files, one exposed to the right and one exposed so that 18% grey is used to determine exposure; and applying to both the compression table; next decompressing those; next processing source and compressed/decompressed files - results are the same? Repeating for ISO 800 "exposed" for 18% and ISO 200 "underexposed" 2 stops for 18% - results are the same?

--
http://www.libraw.org/
 

Keyboard shortcuts

Back
Top