A Beginner’s Guide To Histograms-Part 1

January 27, 2014

A Beginner’s Guide To Histograms-Part 1

If you've done much photography at all, you probably know that your in-camera exposure meter, while being a wondrous mechanism much of the time, can sometimes fail you and the result is an under- or overexposed image.

If you want to get a handle on the exposure that your camera is giving you and be able to better control the outcome up front, it's worth your while to learn a bit about histograms.

You've probably seen a histogram, a small lumpy looking graph, when you've previewed a photo on your camera's LCD screen or maybe when you've edited an image in photo editing software such as Photoshop.

But what exactly is a histogram?

Well, if you will indulge me for just a moment as I channel my inner geek…

Histograms were originally developed by mathematicians to visually depict the distribution of values over a range. Outside of photography, histograms can be used to show the distribution of things such as grades in a class, incomes in a neighborhood, or people's heights.

Now this may sound confusing, but it's actually a pretty simple concept. Let's look at an example.

Say we have a group of male teenagers and we want to develop a histogram of their heights. So we measure everyone's height in inches and keep track of those measurements.

Here's our data.

64, 65, 65, 67, 67, 68, 68, 63, 64, 64, 65, 65, 65, 65, 66, 67, 68, 68, 68, 66, 66, 68, 68, 69, 69, 71, 65, 65, 66, 66, 68, 70, 74, 64, 66, 67, 67, 67, 67, 68, 68, 69, 69, 69, 69, 70, 71, 71, 75, 62, 63, 64, 64, 66, 68, 69, 69, 70, 70, 71, 74, 62, 64, 65, 65, 67, 67, 68, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 71, 72, 63, 66, 66, 66, 67, 67, 69, 70, 71, 72, 73, 63, 63, 67, 67, 68, 68, 68, 69, 69, 71, 72, 67, 68, 68, 70, 64, 68, 69, 70, 66, 67, 67, 68, 70, 72, 63, 64, 66, 66, 67, 67, 67, 68, 70, 72, 73

This gives the following data of frequency of heights of our group of teenage boys:

Height in Inches Frequency
62 2
63 6
64 9
65 12
66 15
67 21
68 23
69 14
70 10
71 7
72 5
73 2
74 2
75 1

And if we graph this data in the form of a histogram, we get the following.

Introduction to histograms

Figure 1

On this graph, the height goes along the horizontal line and the count of each of these, the number of boys with that height, shows along the left vertical axis. And, so, from this graph we can quickly see the distribution of heights within our group of teenagers. We can see how many have a height of 63 inches, how many have a height of 64 inches, of 65 inches, etc. And we can see that the most common height is 68 inches.

This same idea applies to histograms in photography. In photography, histograms show the distribution of luminance—the brightness values—for the pixels in a photo. Brightness values range from 0 for completely black to 255 for completely white and covers all shades in between. So medium gray has a brightness value of 128.

The luminance histogram shows how many pixels have a brightness value of 0, how many have a value of 1, a value of 2… and so on, showing the number of pixels at each brightness value up to the maximum of 255.

To see how this works, let's look at a couple of examples.

Consider the illustration below. It's a very basic image consisting of just three shades—black (with a luminance value of 0), mid gray (with a luminance value of 128) and white (with a luminance value of 255). You can see that about 25% of the pixels in the image are black, about 25% are mid gray and the rest, about 50%, are white.

Introduction to histograms

Figure 2

The histogram for this image would look something like this:

Introduction to histograms

Figure 3

In the graph above, the luminance values show along the horizontal line with the numbers going from 0 (black) at the far left to 255 (white) at the far right. The height of each bar represents the number of pixels of each luminance value. It's easy to see from the histogram that the majority of pixels within the image are white.

Here's another example, this one with five luminance values.

Introduction to histograms

Figure 4

And the corresponding histogram:

Introduction to histograms

Figure 5

As before, this histogram shows the number of pixels of each luminance values. Again here you can see that the dark areas of the image are represented by the luminance values showing toward the left side of the histogram.

Now, in the real world, photographic histograms don't look like these simplified bar graphs because real photographs have hundreds of thousands of pixels and, within these pixels, most of the range of luminance values are usually represented.

For example, consider the image below.

Introduction to histograms

Figure 6

This photo produces the more typical histogram below, screen-captured from Photoshop:

Introduction to histograms

Figure 7

You can see that this looks very different than the simplified bar graphs we saw above. But this Photoshop version can be read just like the ones before. Specifically, the histogram shows the distribution of luminosity and moves from darker to light, black to white, as you move from left to right on the graph.

By the way, you may have noticed that all of our histogram examples so far are in reference to grayscale images. But all of this theory applies to colored images as well. You see, every color has a tone—an equivalent grayscale value— just like white and black and mid-grey. All colors have a corresponding shade of gray. Lighter colors correspond to a light shade of gray while dark colors have a grayscale equivalent that's darker.

You can see this from the image below and it's corresponding histogram:

Introduction to histograms

Figure 8

Introduction to histograms

Figure 9

Here the darker colors in the image—the dark pinks—are represented by the left-most areas of the histogram while the lighter colors—the yellows and lighter pinks—can be seen in the in the areas right-of-center on the histogram.

Okay, so now that you know what a histogram is, it's time to look at using this tool to help you create better images. And that's exactly what we'll do in our next post…!

Leave a comment

Comments will be approved before showing up.

Also in Our Blog

Creative Exposure Part Three: Shutter Speed
Creative Exposure Part Three: Shutter Speed

May 23, 2017

In our last post, we talked about exposure reciprocity and how there are many combinations of the aperture, shutter speed and ISO settings that can yield a properly exposed photo. And with that, we saw how this idea of equivalent exposures gives us creative flexibility when choosing a combination of these exposure controls.

Continue Reading

Creative Exposure Part Two: Exposure Reciprocity
Creative Exposure Part Two: Exposure Reciprocity

May 13, 2017

In our last post, we talked about the exposure triangle. There we saw that exposure is a function of three components:

Continue Reading

Creative Exposure Part One: The Exposure Triangle
Creative Exposure Part One: The Exposure Triangle

May 03, 2017

f you are just getting started in photography, exposure is one of the first things you need learn.

But even beyond that, getting a good handle on exposure and how the different components of exposure work together is essential if you want to take control of your photography and the images that you are creating.

Continue Reading