Photography Tutorial:

What is a "histogram" and what does it show us?

A histogram is simply a vertical bar-chart. It charts the brightness (luminosity) of a given picture. The software used to generate the chart is looking at each individual pixel (dot) in the picture and counts how many are black, white or various shades of gray. The bar chart runs from pure black on the left (luminosity value = 0) to pure white (luminosity value = 255) on the right. The more pixels that have a specific luminosity, the larger the "hump" at that position in the chart. This is not the colors of the rainbow. This is from black through lightening shades of gray to white.

Unfortunately, there is no such thing as a perfect histogram. Each histogram is as unique as the photograph from which it is generated. Generic shots at a baseball game, crowd shots, shots of the forest along a lake with the mountains and sky in the far background tend to have histograms that stretch from one side to the other. A shot where a red rose takes up 90% of the image will have a much narrower histogram. A histogram is simply a chart of the number of pixels ranging from pure black to pure white within a given photograph.

Let's look at a typical, ordinary picture:

Here's what the histogram looks like for this picture using Paint Shop Pro:

This isn't too bad, but before making any changes, let's see what the histogram tells us. You'll notice that there is a grayed-in area like a bell-curve, small on the left, large in the middle and tapering off on the right. There's also a straight line from the bottom left to the upper right of the chart area.

This is a pretty nice balance of luminosity from black to white, but I can see that the left side of the curve doesn't quite reach the left edge of the chart area. This tells me that there is nothing in the picture that is pure black. Everyday pictures without any pure black elements typically have a feeling like there's a gray film over the picture. Digital camera sensors have a much harder time giving us pure black than pure white. It's pretty easy to take pictures that we initially think look pretty good but have way too much pure white. These pictures have no details in the highlight (bright) area's in the picture and we say they have "blown out highlights".

In the histogram for our example picture, you can see that the right side of the bell-curve almost reaches the right side of the chart area, but there are very few pixels in the picture approaching pure white luminance (more pixels give a taller part of the hump).

So what can we do about this unfortunate situation? Beneath the chart area there are three small triangles labled "Low", "Gamma" and "High". For now, let's just look at the Low and High triangles. Gamma adjusts the mid-tones and changes that straight line to a curved one (linear to non-linear). If you left-click and hold the Low triangle, you can slide it to the right a bit until the top point of the triangle is right under the smallest part of the bell-curve of actual picture information.

What does this actually do? By shifting the Low triangle to the right, we're telling the software to replace the luminosity values for pixels in the picture. In effect, we're setting a new zero point for luminosity. The pixels in the photograph at this point on our bell-curve will now have a luminosity value of 0, or pure black.

Now let's do the same thing on the right side using the High triangle, changing pixels in the photograph to pure white.

Now let's compare the before and after pictures. Move your mouse back and forth between the thumbnails to see the effect.

In this case there isn't a huge change but there are subtle differences. Look at the shadows on the fence in the lower left. Look at the bricks in the background. Look at the fence in the background. The morning dove stands out far more in the altered picture. The altered picture just seems to have more depth than the original. Even though the only change made was to the histogram (no sharpening), the altered picture looks a bit sharper than the original to my eye. The original picture didn't have any pixels at either end of the luminous range, no pure black and no pure white. What we've done is we've forced the existing pixels to stretch out over the full 0 to 255 range of the histogram luminous scale. You can see that the altered picture's histogram reaches from the left side all the way to the right side. It's not as smooth as the original because we've had to "stretch" a set of pixels that are less than the total (about 30 to 226) to take up the full range from 0 to 255.

So let's look at some more pictures and their histograms.

So what would you expect the histogram to look like for this picture of my nephew Shane pitching for the Bettendorf Bulldogs? Well, it looks to me like a great percentage of the picture is taken up by the green grass and bushes. Of course, the color of the grass doesn't matter to the histogram, but its luminosity (brightness) does. There's also a lot of the dirt around the pitcher's mound and between the bases. To my nearly blind eye, the dirt looks brighter than the grass so I'd expect that there will be a large hump in the histogram representing the grass and bushes pixels and a smaller hump further to the right representing the dirt pixels. Shane's shirt looks pretty close to black so I think there will be a part of the histogram nearly over to the left side of the chart. The blurry ball and the roof of the shed in the background look pretty much white so I think the histogram will reach all the way to the right side of the chart.

Maybe you're having a little trouble deciding which parts are brighter because the color is fooling your eye and brain. Let's take this picture and remove the color, making it a grayscale image.

The histogram for this picture is exactly the same as for the "colorized" version. Now it's easier to see that there are some portions of the picture near black, a lot of the picture in middle gray (grass), more pixels brighter than this (dirt) and the ball, shed and maybe parts of the fencing in the background approaching pure white. Let's look at the histogram.

Man, oh man, am I good or what? I nailed this one right on ... what's that you say? How do I know that the big hump in the middle is from the grass in the picture and the smaller hump to the right is from the dirt? Oh ye of little faith.

Let's pull swatches of just the grass and the dirt out of our original picture and see what the histograms look like for those isolated parts compared to the histogram for the whole picture.

Let's look at some more examples.

It should be pretty obvious by now that there is no such thing as a single, perfect shape for a histogram. However, paying attention to the histogram of your picture can turn so-so shots into pretty good ones and pretty good shots into "Damn! Did I actually take those?".

Happy shooting,