How To Read and Understand a Histogram

By Ellis Vener

“The map is not the territory” – Alfred Korzybski

What is a histogram and what does it tell us about a photograph?

A histogram is nothing more than a bar graph. It shows how the luminance values in a digital or digitized photograph are distributed. The linear scale in a histogram runs from black at one end to white at the opposite end. With the exception of a scanned negative, the scale runs from left (black) to right (white). About 99 percent of the histograms we use in photography today have 256 increments, corresponding to 8-bit data depth. The histogram maps the distribution of the luminance values either as a composite of the red, green, and blue channels or in each channel, as you may have seen in the histogram display on some cameras and as option in Photoshop.

The horizontal scale of the histogram measures exposure latitude, and the vertical scale measures quantity: it tells us how many pixels in the image have a specific luminosity value. While the horizontal scale is measured in absolute values  (0 to 255) the vertical scale is effected by several factors: the color space, bit depth, and if you are shooting jpegs, the compression level.  

200712we_histogram1.jpg

Above, the histogram display from Adobe Photoshop Camera Raw shows channels represented by different colors.  

That brings up another issue. Exactly what data is the histogram you see displayed on your camera’s LCD preview screen based on? More than likely, the data being sent to the preview is based on a highly compressed low-resolution jpeg using an 8-bit-per-channel version of the color space you’ve chosen and possibly incorporating the tone settings you (or the camera manufacturer) have set as in camera processing parameters.

For those of us who shoot raw and use larger color spaces and 16-bit-per-channel bit depth, there’s more information in the raw file than the histogram will lead you to believe. That’s both a bad thing (not all of the information is represented in the histogram’s analysis of the data) and a good thing (you know that at least you’re working safely).

Figure 1: The extended view of the Photoshop CS3 histogram (above) shows the histogram of a NEF file from a Nikon D300, first processed using Adobe Photoshop Lightroom v.1.3 and output as a 16-bit per channel image in the Pro Photo color space and then opened in Photoshop CS3.  

Figure 2: The histogram changes significantly when a duplicate the image (created in Photoshop CS3) is converted into 8-bit per channel Adobe RGB(1998) form (above).

Figure 3: Above you see the resulting difference in the histogram when a second duplicate was made from the 16-bit per channel Pro Photo TIFF, and converted into 8-bit per channel sRGB form.

Figure 4: The histogram above simulates the loss of data that happens in-camera when you opt for to output a fine/large JPEG instead of a raw file. Notice that while the shape of the two JPEG histograms (Figures 3 and 4) are very similar to each other, there's a definite large spike on the tail of the red channel in the straight raw (NEF) to JPEG version (Figure 4) that isn't there in Figure 3.

So a histogram is a useful tool for helping you analyze, at a glance, how the information and exposure data in a photograph is distributed. It shows the luminosity range of the image along with how it is distributed.

How can we use this information to make better photographs? The late Bruce Fraser articulated a key concept by explaining ”tonal differences are detail.”

The first thing we need to watch for is clipping. A warning sign of clipping is when you have anything resembling a peak at either end of the histogram. Remember: the taller the bar the more data is at a specific level of luminosity. Unless there are detail-free areas of black or white in significant size in the photograph it is likely that your exposure setting (aperture + shutter speed + ISO setting) is destroying (“clipping”) the differences that define detail at the extremes of your exposure. That can be a problem for wedding photographers.

One rule of thumb when using a histogram to evaluate exposure is the oft-cited expose to the right. There is a sound reason for doing this and it goes back to how the CMOS and CCD sensor arrays in digital cameras and scanners work. These arrays are linear devices. In most current DSLR cameras, the CMOS or CCD records data in either 12-bit or 14-bit-per-channel form. Each additional bit doubles the degree of differences that can be recorded.

It’s important to understand that each pixel in a camera’s array is a separate monochrome device. It does one job: record the total amount of light striking it. A 1-bit device is like a light switch: it has two states, it’s on (white) or it is off (black). A 2-bit device has four states (or 4 shades of gray: white, light gray, dark gray, black). A 3-bit device has 8 states (white, six shades of gray, and black), a 4-bit has 16, and an 8-bit device has 256 (2 x 2 x 2 x 2 x 2 x 2 x 2 x2). A 12-bit device has 4,096 and a 14-bit device has 16,384 states it can be in. Obviously, the more states the smoother the transition between one shade of gray and the next.

To keep this simple I’ll use a 12-bit-per-channel model. Devices record light in a linear manner, but the pixels do not evenly share the wealth of detail. The brightest stop of exposure contains half of the available states, or levels of detail (2,048 in 12 bits). The second brightest stop down contains a quarter of the total (1,024) the third brightest contains 512 levels, the fourth brightest 256, etc.

So the further to the right you expose without clipping the highlights, the greater amount of differences you are recording. Once you have recorded the image you can start teasing it apart to see the differences in tone.

When you start with an underexposed image and have to lighten it during processing you create gaps between the steps because you have fewer and cruder gradations of information recorded. Visually this shows up as banding (abrupt changes in tone). Noise begins to visibly become more apparent, too. Yes you can reduce noise with software, but at the expense of detail and time. So exposing correctly in the first place results in both better image quality and saved time.

If you come from a background of shooting film “expose to the right” echoes the advice of master black-and-white photographers who taught us to expose for the shadow details and process and print for the highlights.

Many cameras today now offer the option of either viewing a simple composite luminance histogram or if you choose, to let you examine a per-channel view to see more precisely what the exposure level is in each color channel. If you fall into the class of people who believe that the more information you have to work with, the better informed your decisions are, you should explore this option.

200712we_histogramLR.jpg

The histogram display in Adobe Photoshop Lightroom translates different areas of the histogram in terms a photographer understands more intuitively: Blacks, Fill Light, Exposure, and Recovery (recoverable highlights). These areas are indicated by a lighter gray background when you hover your cursor that section of the histogram.

TrackBack

TrackBack URL for this entry:
http://www.ppmag.com/cgi-bin/mt/mt-tb.fcgi/568

Comments (41)

Bob Hall:

PPA has a penchant for light gray fonts which are difficult to read. Black is better.

Bob Hall:

A histogram is NOT a bar graph. A bar graph is for discontinuous data, a histogram is for continuous data. Had the colors been lumped into groups, like Red, Green, Blue, with no in-betweens, one would present the data as a bar graph.

Bob Hall:

Nicely written article!

This is a clear and well written article. Covers the subject in an intelligent, easy-to-follow manner.

Neal:

Actually, a histogram is a bar graph, because the data is discontinuous. The very nature of a digital capture assure that is is 100% discontinuous - it just looked like it isn't.

this is really good info ...
all i knew about histograms is that we should try to make it like mountain and it should be in the middle ...
thanks for this info ... this is good ...

Very helpful info for a new photographer like me. Thanks!

Brendan:

A histogram is not a bar graph. Ask any statistician.

Scott:

A histogram is a distribution of binned data. It resembles a bar graph, but reports data by height, where a bar graph reports data by area. However, for the sake of layman's arguments, the point is to make non-statisticians understand the concept.

Anyway, the article has some nice insights for folks new to the idea of using a histogram. Statistical lexicon notwithstanding.

Ross:

This in fact IS a bar graph. For it to be digital, that means it has to be non-continuous. Each color has to be represented as color X or color Y or color Z, etc. There are just so many colors on the bar graph (and the nature of shading is such) that it appears to be continuous. But if you want truly continuous, you have to use analog (aka film), which can capture infinitely small subtleties in light differences. A digital camera must at some point assign it either one color value or another.

Mark:

I'm more confused than when I began.

Great article! This is a good lesson for anyone with a digital camera (that displays a histogram) as I would assume most who buy digital cameras are fully learned on all its features.

A lot of the photographs I take are product or set up shots. Knowing the histogram helps me take better photos that show all the item's details (even in shadow) without turning the highlights into bright, white blotches.

I only wish that more lower end digital cameras shot to (or at least gave the option) a raw format or, at the very least, something uncompressed, like TIFF. For personal use I prefer a more compact camera but desire the options of higher end camera. Dragging a $700 digital SLR everywhere for quick photos isn't convenient but the quality of my photos suffer due to the lack of features on most small, pocketable cameras.

Oh, off topic, what is this blog's anti-spam "type this word" measure called? I am looking for myself and a friend.

pepemosca:

Great text! Thanks!

Paul:

Great article. Best I've read here so far. Ellis is a wonderful contributor to photo.net and I was glad to see him as author.

R:

Aaron-
You might be looking for the term CAPTCHA?

Roc:

Bob! Neal! Scott! Ross! Why is it necessary to belabor inconsequential distinctions between continuous and discontinuous - with respect to histograms? Who cares all that much?! Lunatic fringe literalists will debate anybody about anything with little more purpose other than to just be an annoying pain in the butt. In the end, the point to be made (if there ever was a point) is barely relevant, and usually ridiculous. If you simply enjoy grinding away in an endless, useles nagging debate, let me introduce you to my ex-wife!

What is photo histogram?
http://garmahis.com/tutorials/what-is-photo-histogram/

Ellis, well written and easy to understand. You just eared a spot in my RSS aggregator. Nice work!

OMG... it's funny to watch the "rabbit hole" that the conversation went down. I especially like Roc's comment! Thanks for the perspective. On the article... I enjoyed it. Succinct, detailed but not too long and great visual examples. Thank you.

Adam:

The problem with this article is that someone who understands terms like "distribution of luminance values" and "discrete channel data" already knows exactly what a histogram is, or can quickly figure it out. Not going to help my budding but non-technical photographer girlfriend.

Nice article: and could care less whether it's a bar graph or not.

I think I get it...
"Keep the lumps in the square."

Ryan:

Bar Graphs are cool

Very nice article on the Histogram palette. I love that someone is still shouting "expose to the right."

Jim Hoerricks
Forensic Photoshop

shuttersue:

I read this article and unfortunately still don't know what i should be looking for on my histogram.
although the article does explain a little more to me, i still don't know what a "good" histogram should look like, and once i do know that, not sure how to get it there.
can anyone please go a little more basic in an explanation?
thanks

It took me two years to figure out how not to ignore historgrams.
Great article!

JK

MC in SC:

I was going to post a comment contrasting the usefulness of the article to the irrelevance of the statistical arguement from the "pocket-protector types" above, but I think I'll just add a DITTO to Roc's comments....except about the ex. I don't think I know her.

Booker:

Not to belabor the debate, but while histograms do differ from bar charts technically, the distinction is only really important when the bins (horizontal axis units) are of different width, because histograms look at area whereas bar charts look at height (or amplitude, on the vertical axis).

With digital (non-continuous) data such as from you camera, each gray level is equal in width, so the distinction is blurred, and in fact the data can be legitimally generalized as continuous, particularly with finer units along the horizontal.

With regards to the article itself, I agree that while it's well written, it is a bit incomplete. I'm no expert, and some explaination about what luminescence actually looks like would be great. Likewise, many DSLRs allow a brightness histogram as well, how do these two histograms relate? And what techniques can I implement to identify elements of a scene and then set my camera up to better use available levels in a shot prior to releasing the shutter?

Excellent read, of course if you still can't understand histograms after reading this very nice article then set your camera to flash any areas that appear burnt out - at least then you have another indicator of exposure reading. (or too far to the right the histogram is)

Perfection, well done with the article. Histograms, no longer a black art!

Histograms need to be read differently when in different places. Turkey has some warm colours whereas in the UK the cloud can make more moody shots.

Excellent guide on histograms, thank you for helping us out.

This is absolutely helpful. I am a budding photographer and this is really cool.

Great article! Thanks for sharing!!

Been looking for a good explaination of histograms for ages and this has made me understand 100%.

This is really helpful, thankyou.

Thanks everyone. If you have more questions, please ask away!

Ellis Vener
http://www.ellisvener.com

Thanks for this article. How to use the histogram has become that much more clearer.

I'm so glad to have found this tutorial, because I always have trouble understanding histogram everytime I use Photoshop. Thanks a lot, this is a big help understanding it.

Wayne:

I am working in a class and have an assignment to produce photos, using a canon EOS XST Rebel camera, with the histogram being as flat as possible. Can anyone tell me the best way to do this?

@Wayne: Did you figure it out yet? I have an idea, but I think you're supposed to figure it out on your own for a class assignment.

About

This page contains a single entry from the blog posted on December 1, 2007 5:54 AM.

The previous post in this blog was Review: Showit Web v2.6.

The next post in this blog is First Look: Nikon D300.

Many more can be found on the main index page or by looking through the archives.


 
Powered by
Movable Type 5.2.7