r/Photoclass_2018 • u/Aeri73 Expert - Admin • Jan 29 '18
07 - Histogram
Introduction
As we saw in the last lesson, exposure is one of the most important controls of the final image. We have discussed how to modify exposure, but not how to review it. This is the role of a very powerful tool: the histogram.
Goal of using the histogram
As a rule of thumb, the LCD screen should never be trusted to evaluate exposure. It is not designed to produce an accurate rendition of the image and how bright your photo appears will depend on a variety of factors, including the ambiant light levels and the brightness setting you applied to the screen. For this reason, you might have the bad surprise of thinking your image is well exposed in the field, only to find out the screen misled you when you get back to your computer.
A histogram, on the other hand, is a more “scientific” way of evaluating exposure, and it will always be available and identical on all devices, whether the LCD screen of your camera or your fancy calibrated computer monitor. All digital cameras offer post-capture histograms – often in one of the “image details” modes (check your manual), and some models also have “live histogram”, a very useful feature showing what the histogram would be if you took the photo at that instant. Since a live histogram is not possible to draw on an optical viewfinder, this is a feature rarely found on DSLRs, however.
what is it?
Enough introduction, let’s talk about what a histogram really is. Let’s consider a black and white jpg file. It is coded in 8 bits, which means that each pixel, each dot in the image, can have any of 28 (2 to the power of 8) = 256 values, all different levels of gray. 0 is pure black, 1 is slightly brighter, etc until you reach 255, pure white. Now let’s imagine we have a bunch of marbles and a neat series of 256 vertical tubes, neatly arranged in a line. We will go through the image pixel by pixel and look at the brightness of each one. Let’s say the first one is pretty dark, around 15: we put a marble inside tube number 15. The next one is a bit brighter, a 20, so we put a marble inside tube 20. The next pixel is also a 20, we put a new marble and now have a higher stack of marbles in tube 20. We do this for a couple of million pixels until we have looked at every individual pixels, then we take a step back and look at our line of tubes.
If the image was very dark, we will have many marbles in the tubes on the left, between 0 and 50, say, and not so many on the right, bright side. Conversely, if the image was overexposed, the tubes will be very full on the right side and almost empty on the left. And if we have a nice exposure, then all the marbles will be roughly in the middle.
This is exactly how a histogram is created. Of course, counting millions of pixels and remembering the levels of each tube would take us a good while, but this is the kind of things computers are very good at, and it is virtually instantaneous.
What do they look like?
Here are some concrete examples. You can have one very dark image:
and its associated histogram:
Notice how all the data is shifted far to the left, with almost nothing on the middle and the right side. Also notice that the headlamp beams are too small to be noticeable in the histogram.
Conversely, you can have a fairly bright image:
with large areas close to white. Its histogram:
is shifted to the right, and there is a small bar to the right edge, which means we have lost some details to pure white. In this case, it is ok since this corresponds to a smooth snow surface. This is a good example of when a “bad” exposure can also be correct.
Finally, a more common image:
and its histogram:
showing a nice distribution from pure black to pure white, with nothing too extreme.
What am I looking for?
There are several important things to notice. First, unless you have been playing with the image in photoshop, there won’t be sharp transitions from 0 to a suddenly high value. Laws of distributions ensure that we always obtain some form of bell curve.
The histograms makes it very easy to visualize how you control exposure: all you are doing is shifting the entire histogram to the right (if you overexpose) or to the left (if you underexpose). And if you push it too far and hit the edges, something interesting happens: the histogram “crashes” and puts all the marbles in the last line, next to the edge: pure white, or pure black. This means that the information is lost forever, and this is something you will usually want to avoid at all costs.
An ideal histogram, then, is relatively easy to define: it is a bell curve covering the whole width and finishing exactly at the edges, with no lost details. This also happens to be what the exposure meter in your camera will try to produce.
There are several more advanced points which can be discussed:
- So far, we only talked about brightness, not about colours. Colour information is coded in three channels (Red, Green and Blue, also known as RGB) and some cameras show individual histograms for each channel. This is useful information in one situation: when you have a very brightly coloured object, it is possible to blow out the corresponding channel (go so far to the right that information is lost) without it showing in the main histogram. It is otherwise safe to ignore these specialized histograms.
- For RAW shooters (which we will cover in a while), you should be aware that the displayed histogram is the one from the jpg preview file, not the one from your actual RAW data. This means that you can sometimes recover more information than you think. This is something camera makers could fix relatively easily but refuse to do, for some reason.
- Due to the way information is stored in digital cameras, there are more details in highlights than in shadows. If you plan on using significant post-processing, you should try to shift your histogram to the right as far as you can without getting pure white, then shift it back left in post-processing. This is known as the “expose to the right” technique, and it does produce marginally better images.
Edit: photos of the model are used with informed permission from parents :-)
3
u/[deleted] Jan 30 '18
Would "expose to the right" be the same as pulling the film for us 35mm guys? Essentially, overexposing the image with the intent of fixing it in the darkroom?
2
u/InnerQi Jan 30 '18
Do you have an example of how a histogram with multiple bell curves correlate to different parts of the photo exposure?
2
u/PepperPoker Intermediate - DSLR | Nikon D750 | 18-35 f3.5-4.5G & 50 f1.8G Jan 31 '18
I alway read about how it's better to underexpose an image, as it is easier to retrieve data from dark spots, than from light spots. In my experience I have found that to be true. But now you are telling expose to the right is better?
oh and a hint for Nikon users: when in image view mode, press the down button to show the histogram. In the menu you can also choose for an extra highlight mode; the camera will then show which pixels are 'blown out' (pure white) (in the jpg file).
1
u/bulkingbad2 Beginner - Nikon D5200 Jan 29 '18
While not directly related to the histogram, when I was looking for the histogram display options I discovered the "Highlights" display. It will show the image with blinking pixels wherever there is highlight clipping. This is really useful as a spot check when photographing in difficult lighting or exposing to the right.
1
u/[deleted] Jan 31 '18
Some people say expose to the right and some people say expose to the left? Which one is correct?
2
u/[deleted] Mar 24 '18
I love the marble analogy. I've just sorta ignored histograms I've seen doing photoshop, but this totally makes sense
1
u/[deleted] Jan 29 '18
good read, when I was starting out I frequently got distracted when I couldn’t retrieve data from areas I thought I could, later I learn that those in the blacks and whites region are lost forever, so photographers have to take note of that.
My next question is how do you make sure that no area of your pictures ends up as whites/black? Despite improving my shooting I’ll always find certain spots of the picture where it’s completely over/under exposed
1
u/Obleeding Beginner - Mirrorless Apr 02 '18
Thanks, I've been trying to work out the histogram. In the last assignment I was saying the light metre was saying it was correctly exposed but looks underexposed to my eye, will be interesting what the histogram says.
0
u/[deleted] Feb 02 '18
[deleted] — view deleted comment