Westminster fountain at sunset

by Jorge Córdoba

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.

Following up from a previous related raw file latitude question. Why do RAW files record in 14 bit but only show 8 bit of data? The remaining data is hidden away to the right or left of the histogram. Therefore some details are lost without manual manipulation. Why not just show all 14bit to start with?

share|improve this question
2  
For one thing, most screens can't show 14 bpp colour. –  Chinmay Kanchi May 23 '13 at 17:57
3  
This has nothing to do with RAW files, but whatever software you are using that displays the histogram. Files don't show you anything. Application software does that. –  Olin Lathrop May 23 '13 at 18:37
    
Based on the reference question, I assume your are talking about the histogram on camera. An application shows you the histogram of the converted image. –  Itai May 23 '13 at 19:04
1  
@Itai Considering that the mapping takes the range of the 14 bit and compresses/shifts it when the conversion to jpeg happens, the data that is lost isn't necessarily limited to just the left/right extremes, but could also be represented by sections in the middle of the range that get squeezed out from the conversion. The histogram from that would need to take into account conversion losses which would cover the range of the histogram, no? –  Wing Tang Wong May 23 '13 at 22:50
1  
@WingTangWong - Yes, there is loss all over the range but, when you consider how values are bucketed together in a histogram, they would be close to the right place and be representative of the distribution of values. That does not cause much issue, what does is not seeing the extremes of the range since one cannot tell when things have been clipped by exposure. –  Itai May 24 '13 at 1:35

5 Answers 5

The issue has nothing to do with bit-depth but with how much dynamic-range is shown.

RAW files record a certain number of bits per photosite. This is usually 12 or 14 bits. JPEG images offer a fixed bit-depth of 8-bits per color-component. What nearly all cameras do is create a JPEG preview for the RAW file and compute the histogram based on that preview. This shows the correct histogram for JPEG images. If you shoot RAW+JPEG, it is also correct for the JPEG one. For those who shoot exclusively RAW, then obviously the histogram ends up being incorrect.

The discrepancy has to do with how the JPEG preview is rendered which is affected by image parameters. The lower the contrast, the more dynamic-range gets preserved in the 8-bits of space. In theory, one could show the entire range in a histogram but most cameras do not support contrast that low since compressing a high bit-depth image into 8-bit of space with no clipping would make it look extremely dull.

There is no camera screen that can show even 12 bits, since the horizontal resolution is too low. The histogram is always made of buckets each represent more than one luminance or color value, in the case of RGB histograms. If one were simply to drop the lower bits from RAW data, we could have a perfectly representive 8-bit histogram for a RAW file but only one camera AFAIK does this. The issue is that most cameras drop values at the extremes of the RAW values and map the rest to an 8-bit space which is what happens when producing a JPEG image out of RAW data.

share|improve this answer
    
Why would compressing a high bit depth image into an 8 bit space make it dull? It would still have really dark blacks and really bright whites no? –  erotsppa May 23 '13 at 21:40
1  
While the extremes may be used and the image would have a high overall contrast if the entire dynamic-range is used, micro-contrast would be extremely low, so things would lose texture and look as if seen through a thick fog. –  Itai May 23 '13 at 22:13

Well, you could open the raw file in a hex editor and read the 14bit values as 0x0000h-0x3FFFh if you like to have the "raw show you the 14bit data".

Alternatively you can map the entire range linearly to be viewed on your 8bit display, so there is no cuts in either end:

linear

Now, that looks really boring. How abuot we apply 2.2 gamma curve to make use of how the monitor and eyes work together:

gamma 2.2

A bit better, but still not pleasing. Let's do some basic "photo developing" such as auto clipping and colour space conversion (sRGB):

real development

share|improve this answer
    
Minor nit: 14 bit hexadecimal values go from 0 to 3FFF, not 0 to 4000. –  Olin Lathrop May 23 '13 at 21:17

Virtually all computer, tablet, smart phone, etc. displays are limited to 24 bit color (8 bits per each of the Red, Green, and Blue channels). When an application displays an image file on such a screen, it has to either:

  • Choose an 8 bit zone of the original 12 to 14 bit data to display, with the brighter tones blown out and the darker tones pure black

    or

  • Compress all of the Dynamic range of the original file into the 8 bit space, which makes the image look very dull and flat

    or

  • Use a combination of the two methods above

Since your original question deals with histograms, we'll assume you also are referring to them here. The histogram on the back of the camera is based on the image rendered on screen, not the original RAW file. I suppose it would be possible for the camera to display a histogram based on the full dynamic range of an image file, but it would reduce the overall speed of the camera, since the camera would in effect now have to produce two different preview images for each file: one to display and another to base the histogram on. It would also require a higher resolution LCD on the back of the camera. There are probably dozens if not hundreds or thousands of potential buyers more concerned with frames per second (fps) and buffer depth compared to the number of potential buyers more concerned with the on-camera histogram displaying the entire dynamic range of a RAW image file. Which way do you think the designers are going to go with their products?

The LCD display on the back of your camera is designed to make every picture you take look as good as it possibly can. In other words, it lies like a politician! If you are viewing a 25 MP image on a 1MP screen it means that each pixel on the screen is displaying a combined 5X5 pixel area of the original image. Your focus could be blurred by as much as the width of four pixels and you wouldn't be able to tell a difference from a perfectly sharp image! Likewise, the color and contrast are rendered in a way that the manufacturer thinks is most pleasing to the most potential buyers. If the preview picture on the LCD screen reduced contrast enough to display the entire dynamic range of the RAW file, no one who buys a camera based on how the picture they just took in the crappy light of the store looks on the back of the screen would ever leave the store with one.

share|improve this answer

Mostly because such a preview would be meaningless. When you go to do final output, you are virtually always outputting in 8 bit color and the display itself is 8 bit. Having a display that approximates final output is generally more useful that one that captures the whole amount of information stored. I suppose you can't tell immediately if highlights will be recoverable or not, but you get a far better idea of what a final output will look like and it doesn't require a much more expensive display to show it on.

share|improve this answer

Lots of technically correct information/ answers here, but I think you are misunderstanding histograms. Two issues:

  1. If you are referring to the fact that displays sometimes show the number 256 - This is just a convenience. 256 is maximum exposure just before blow-out for notional 8 bit capturing. Key is that images with more bits per channel will just have detail between the whole numbers down to 0. Think of it like scaling on scale of 0 to 255.

  2. If referring to displays with the normally 5 areas - these show stops of exposure. This makes the histogram log scaled. I.e. reading from the right. One line back will be one stop less... so 128 on our nominal 256 scale, next line will be 64, etc. last one is 8. so if it was truly an 8 bit image you only have 8 levels available for thing 5 stops below full exposure. This explains why low bit images have limited to exposure correction possibilities.

So in short. 256 is sometimes just used as a nominal scale even though there might be more bits. If referring to the 5 stops shown in histogram: higher bit images will have more detail at these light levels, but for 99% of exposures you will just have (close to) zero readings on histogram for these.

share|improve this answer

Your Answer

 
discard

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.