House of Hacks

Saturday, February 21, 2015

How to easily read a histogram


The camera’s histogram can be intimidating if you don't understand it, but it's actually really simple. In the first of a short series, Harley introduces this powerful tool to facilitate photographers' quests for the perfect exposure.

For a written transcript, go to How to easily read a histogram

Music and sound effects under Creative Commons License By Attribution 3.0.
Intro/Exit: "Hot Swing" by Kevin MacLeod

Photo credits for Creative Commons license 2
Illusive Photography: Photo
Alessandro Valli: Photo

Sound effects credits for Creative Commons license 3
fasten: Slide projector
VlatkoBlazek: Mechanical Whirring
leosalom: Fire



Besides the basic controls for making an image, I find the histogram to be one of the most used features of my digital camera. Today at the House of Hacks I'm going to explain what it is and the meaning of what it shows.


Occasionally I work with people in photography related teaching situations. Many times I've found individuals trying to evaluate an exposure based on the preview image on the back of their screen.

This is a really bad idea. Chimping is great to evaluate the composition and relative exposure but there are many factors that control how the image is displayed that make it a poor representation of the actual exposure.

The histogram is a powerful tool in the photographer's arsenal to evaluate an image for proper exposure. And it's one of the few features that can't be duplicated on a film camera.

The closest we can get in the film world is an exposure meter. But in the digital world, the histogram provides a whole lot more information. In this episode, my goal is to explain the basics of what the histogram is and the meaning of what it shows.

In future episodes I plan to show how to use it when making an image. They'll be added to this playlist when they're posted.

Simply, the histogram is a chart showing the various brightness levels of an image. The left side of the x-axis represents black and the right side represents white. The values in between are levels of gray from dark to light. The y-axis represents how much of the image is at each value on the x-axis.

Let's look at some simple examples. To make things a bit easier, let's visit an alternate universe.

[Finger snap]

In this world, things are much more pixelated with higher contrast and fewer colors so our histograms can be smaller. When the sun goes down everything goes to black and white and a couple shades of grey.

Here's a nighttime image. Let's construct a histogram for it. First, we'll draw the x- and y- axes.

Since our image only has four values, black, white, dark grey and light grey, the x-axis has four points.

First we count the number of black pixels. Then we draw a bar that high.

Then we count the number of dark grey pixels and draw a bar that high.

We continue the same process with light grey and white.

And there we have it. A histogram for this image.

Let's change the image a little... and see how it changes the histogram.

More grey in the image increases the grey column of the histogram and decreases the white side.

Here is the same scene during day... with it's histogram.

A color image can be treated as a black and white image, with many shades of grey.

In this case, the histogram just has more grey levels on the x-axix.

Let's look at a couple generated images to get an intuitive feel for how the image impacts the histogram.

Previously I've shown simplified histograms with just the number of items on the grey scale x-axis as there are in the image. From now on, the histograms will be configured to have 256 values on the x-axis from black to white.

This black and white image gives us two bars in just the black and white columns on the two edges.

This black and white image gives us the same histogram because the relative amount of black and white portions of the image are the same.

It doesn't matter how we divide this up, as long as we have the same number of black and white pixels, the histogram remains the same.

Similarly, if we have this black and white image with one-third of the image white and two-thirds black, we can see the black side is twice the size as the white because we have twice the number of black pixels.

And again, we can divide those pixels up anyway we want, but the histogram doesn't change.

Now let's look at this gradient image.

Its histogram is a straight light.

Does this surprise you?

If we look at the image, we have a black band and a white band and all these grey bands that are the same size. So the graph reflects this with a straight line.

If we move the black and white start points, then the histogram will have taller ends with a dip in the middle.

But if we move the black and white start points off the image, then the histogram will shorten on the ends and rise in the middle.

[Finger snap]

And the default histogram on your camera works exactly the same way. Each image is treated as black and white and then the histogram constructed from that.

I don't know about all cameras, but all my Canons have two types of histograms: luminance and RGB. The luminance histogram is a single chart that shows the combined luminance values for the overall image. The same thing as what we’ve been looking at here.

The RGB histograms work exactly the same way except there are three charts showing the intensity in each of the color channels.

The default is to show the luminance but it can e changed to the RGB histogram by changing a custom setting in the menus.

This can be useful in situations where you have colored lights or part of your image that is more predominant in one color than the others. In these cases, one channel might become overexposed but it won't be obvious in the luminance histogram. However, when you change to the RGB histogram it becomes quite obvious.

And that's how you read a histogram. The left side shows how much black you have and the right says how much white you have and everything in the middle indicates shade of grey.

In future episodes I plan to show how to use this information while making an image and what it means to shoot to the right. If you want to be notified when that, or any other maker related episodes, are released, hit the subscribe button.

Thanks for watching. If this helped you, I'd appreciate knowing about it with a "like." If you have any other questions or other comments, I'd love to hear them in the comment section below.
