a7 March 2014

Tutorial: Understanding Histogram

Histogram - one of the most popular and useful tools photographers have at their disposal.

It's displayed on our cameras when reviewing photos, it's present in Photoshop and Lightroom, many photographers mention it as an essential tool for their workflow. Histogram can be used to evaluate exposure, improve contrast and prevent highlights (or shadows) clipping.

If you would like to understand what it's really about, make sure to read this tutorial.


First of all, what on Earth histogram is? It's really simple. Histogram is a graphical representation of distribution of data and it is represented as a series of adjacent rectangles which height shows value (the higher the rectangle, the bigger value it represents). In other words histogram shows you how many members out of a whole group belong to a given class or category.

Let's consider following example (I know it doesn't make much sense but anyway...). Let's say you have a group of 129 people and you are interested in how many people have given height. You could represent this by a table or a graph - histogram:
Example histogram

Each of the rectangles in our example corresponds to given height. From it you can easily see that height of 175 cm is the most common, with 30 people being that tall. You can also read that there are fairly few people with height of 190 or more centimetres.

In case of photography histogram shows distribution of luminosities (instead of height). Luminosity is a measurement of brightness - that is it tells how bright given pixel is. The higher the given rectangle is, the more pixels have given luminosity. Take a look at the example histogram from Adobe Lightroom:
Example histogram

As you can notice it looks slightly different - there are no spaces between rectangles and there are no numbers on it. I'm telling you why. People from the example above, in photography correspond to pixels. Let's say you have a 18 megapixel camera. It means that photo captured with this camera has 18 million of pixels. Now, you don't need to know if there are 165 or 167 pixels that are completely black because it won't tell you anything usefull (and such small differences doesn't really mean anything) so photography histograms typically doesn't show any numbers nor scales. What's important for you is to be able to see relative differences between various luminosities. If you see that the rectangle corresponding to black is twice as high as the one that corresponds to white it will mean something. If you will see there are no rectangles corresponding to shadows it will also tell you something.

You just need to learn how to interpret the photography histogram. We're moving to this in a second.

But first a word on luminosity. Normally (please note that we're not talking about HDR histograms here) there will be 256 different luminosities in your image - from 0 (black) to 255 (white) both ends inclusive. Luminosity values increase from left to right, meaning that left part of the histogram corresponds to shadows while right part corresponds to highlights. Rectangles in between are for midtones. As I already said, the longer the rectangles, the more pixels have such luminosity.

Also luminosity of a pixel (or simply brightness) isn't simple mean of Red, Green and Blue channels (i.e. luminosity is not equal to (Red + Green + Blue) / 3). It's because our eye perceives each of the channels differently, with green affecting perceived brightness mostly. Most commonly used formula to calculate luminosity is therefore:

luminosity = 0.30 * red + 0.59 * green + 0.11 * blue

But bear in mind there are other formulas as well.

Now I will eventually show you how to read histogram, interpret it and based on it improve basic image characteristics.

Exposure and clipping 

One of the most common and important things that you can read from histogram in photography is evaluating whether exposure of the image is correct or whether image is overexposed (meaning it is too bright) or underexposed (too dark).

A few typical situations are shown below. First take a look at the histograms in the left column and after that on the example photos in the middle column. Finally take a second to read the descriptions that will provide further explanations:
HistogramExample photoDescription
In this case the photo is heavily underexposed. You can tell this by the fact that histogram is very left-aligned. Almost all rectangles occupies luminosities corresponding to shadows and there are no rectangles in the "highlights" (in the right part) section of the histogram what means that there are no bright pixels at all. Only dark ones - hence the photo is dark too.
This image in turn is heavily overexposed. You can tell this by the fact that histogram is right-aligned with almost no rectangles in the shadows section of histogram (meaning there are virtually no shadows - only highlights). There are no dark pixels at all in this image.
This image is correctly exposed because it has rectangles quite uniformly distributed across whole histogram meaning that there are both bright and dark pixels as there are rectangles in both highlights and shadows sections of the histogram.
Here's a little catch - sometimes histogram doesn't tell whole story. This image should be heavily underexposed based on its histogram (because it has no bright pixels at all) but in fact it has correct exposure or at least such that I found correct for this type of image. It was taken at night so viewers will expect that it isn't as bright as photo taken during day.

Similarly there might be cases where photo is too bright based on it's histogram (eg. photos on snow, beach or high-key portraits) but in fact it might have correct exposure.

The last image is very interesting because it shows one thing. Apart from looking at the histogram and following it's advice blindly you need to think what you want to achieve. If you want to create moody photo, you might want to underexpose it a little. If you want to show how bright the snow is, you might decide to overexpose it. What I'm trying to say here is that you should treat histogram as guideline, some kind of suggestion - not as a rule that you must always obey.

So you can now tell whether exposure of the image is correct based on its histogram. But regarding exposure, histogram can tell you one more thing - whether there is any highlights or shadows clipping in the image. Sometimes, certain portions of the image are too bright and they don't contain any detail - they are represented as pure white despite the fact there were some details in them. Take a look at the overexposed image above. The sky is almost completely white, even though you know there were a lot of details in it - both sky and clouds. But they disappeared, they got "clipped".

You can easily read this from histogram - if there are any rectangles that are adjacent to the right border of a histogram you're most likely experiencing highlights clipping. It's because right most column of the histogram corresponds to completely white pixels (255, 255, 255 in RGB) To prevent this you will need to decrease exposure a little bit (try with 1/3 stop of light, if it doesn't help with 2/3 or even whole stop of light). It's similar for shadows but in this case they are clipped if there are rectangles adjacent to the left border of the histogram.

Unfortunately histogram alone doesn't tell whole story here. Although it can tell you whether there is some highlights/shadows clipping in the photo or not it won't tell you which parts of the image are clipped. You might think that you should always avoid overexposing but that's not necessarily true. Sometimes it's ok to blow out some parts of the image (like parts of the clouds). For this reason it's good to use more tools for detecting clipping. Most cameras have feature that shows parts of the image that were clipped. It's also possible to enable clipping alert in Lightroom - just click on the 2 triangles visible on the histogram.


Histogram can be also used to evaluate and improve contrast of an image. The narrower the histogram, the lower contrast the image has. By narrow histogram I mean that rectangles are condensed in one part of it (eg. in the middle).

Take a look at this image. Its histogram (you can see it in top right corner of the image) is very narrow and indeed the image has very low contrast (-100).
Narrow histogram = low contrast

Now take a look at another image. It's the same photo but this time I increased the contrast quite a lot. Histogram of this photo is much broader this time:
Bright histogram = high contrast

So if you see that image has narrow histogram it might mean that your photo will benefit from increasing contrast.


That's all for today. I hope that you now understand what the histogram is and how to use it to improve exposure and contrast of your photos. If you have any questions or would like to learn even more about histogram - just let me know (eg. in the comments below this tutorial).

Post a Comment