# Understanding the Histograms...



## mnmcote (Jun 4, 2014)

I've got a grasp on the concept of the histogram. Left to Right.. Darks to Lights.. But.. I'm still working on understanding what the actual histogram is telling me about the picture...  Can someone offer some tips and/or suggestions on how I can better understand histogram data in layman terms..

In short I think I'm looking for a Histogram for Dummies lesson... 

Thanks...


----------



## The_Traveler (Jun 4, 2014)

Luminous Landscape has an excellent article Understanding Digital Camera Histograms: Luminosity and Color


----------



## mnmcote (Jun 4, 2014)

Thank you.. I'll go check that one out..


----------



## IgsEMT (Jun 4, 2014)

Thanks for sharing.


----------



## Redtech (Jun 4, 2014)

Thanks for the link.  I've been wondering the same thing


----------



## 480sparky (Jun 4, 2014)

http://www.thephotoforum.com/forum/...14-demystifying-histograms-2.html#post2816853


----------



## Boney (Jun 4, 2014)

This type of histogram represents the distribution of all the pixels in the picture.  The axis going from left to right or the "x" axis represents the value of the pixel or otherwise it's amplitude.  The vertical or "y" axis represents the number of pixels at each amplitude value.  For an eight bit system there will be 256 horizontal or x values shown.  The left side of the graph starts at the value of zero and goes to the value of 256 on the right.  The maximum value on the y or vertical axis is the number of pixels at that particular value.  The area under the histogram curve will be the total number of pixels.  So if the sensor contains a million (1000000) pixels there will be million values on the histogram graph.
A perfectly uniform picture would be represented by a single vertical line 1000000 pixels high at the value representing the uniform picture or its brightness.  So if the picture was was half its maximum brightness that line of amplitude 1000000 would be shown at the middle of the graph at a value of 128.
If the whole picture was of a checkerboard, where the bright squares were at maximum amplitude of 256 and the dark squares were of amplitude zero, the histogram would be of two lines each 500000 pixels high located at the horizontal values of zero and 256.
A real picture would have some pixels at generally all values on the horizontal or x axis.  The bright areas, like glints or shiny spots would be located more to the right side of the graph and the dark or shady areas would tend to be at the left of the graph.
Looking at a real picture histogram gives one a sense of exposure distribution.  If your picture is overexposed then the pixels will tend to pile up towards the right side of the graph and underexposed pictures will pile up more at the low or dark side of the picture.
A picture of a real uniform surface will be shaped like a narrow spike with some width and height.  This spike if examined closely, will have Gaussian or bell shape to it, though it may be very narrow.  The width of this spike would represent the amount of noise in the picture.


----------



## Ysarex (Jun 4, 2014)

mnmcote said:


> I've got a grasp on the concept of the histogram. Left to Right.. Darks to Lights.. But.. I'm still working on understanding what the actual histogram is telling me about the picture...  Can someone offer some tips and/or suggestions on how I can better understand histogram data in layman terms..
> 
> In short I think I'm looking for a Histogram for Dummies lesson...
> 
> Thanks...



In layman's terms then:

You're off to a good start by using the term "data" in your question. A digital photo is digital data. The histogram is a graph of that data. Critical points:

1. The graph contains two threshold limits -- the left and right walls. No data is recorded beyond those threshold limits. One of those "duh" kind of points but really important. Those two threshold limits have a direct and real connection to our physical world of photographic reality. The left limit (black) is the blackest ink we can make and the right limit is the whitest paper we can make. If we put that black ink on that white paper we're making a photographic print. The engineers who originally established the parameters of that histogram were very pragmatically focused in what they were doing. It has direct practical application in that more data -- data beyond those two limits -- can't be forced onto a final print. *The histogram therefore is a graph of how your digital data will ultimately print.* If you're breaking either threshold limit then your final print will either contain black holes devoid of any detail or white holes nuked into oblivion.

2. The histogram is a graph of your processed RGB data and not a graph of what your camera sensor recorded. (It is possible to graph the data your sensor captures but this is not commonly done). Again since the histogram is designed to be a representation of how your data will ultimately print it is drawn from an RGB photo that has been processed with that goal in mind. That processing is either done by the software in your camera (JPEG) or by you from the raw file. A camera raw file contains the full data set recorded by the sensor and can be processed to different results. *HERE'S THE POINT:* The RGB histogram you see is a sub-set of the sensor data and it is *much less data* than the sensor recorded -- it is processed data. This is important because we want to understand that the processing that was done could have been done differently or still can be done differently if a raw file is available.

3. We can define general rules for what makes a good photo. There will always be exceptions of course, but they are exceptions. The exceptions can be talked about as a special topic for example night photography. We can relate the general rules to the histogram.

Rule #1: A good photo has black in it. This relates to the histogram because when we look at the graph we want to see that it reaches the far left corner. It's even OK for the histogram to begin to pile-up against the left wall (threshold limit) a little -- just a little. Small scattered shadows in a sunlit scene that are full black are OK and in fact expected. Here's a judgement call: if that black shadow comes together and gets large enough it becomes a black hole and we all know what black holes do.

Rule #2: If the histogram doesn't reach the left corner the photo better be an exception as in a photo of clouds in the sky. That would be a case where no black in the photo is OK.

Rule #3: There are two kinds of highlights, diffuse and specular. A diffuse highlight has texture and color -- puffy white clouds for example. A specular highlight is a reflection -- think chrome on a motorcycle in the sun. If your photo has specular data then the histogram should show that data as piled up against the right threshold wall; it's pure white. If your photo has only diffuse highlights they should graph as close to the right corner as possible without hitting the threshold wall otherwise they lose their detail and color.

Rule #4: A good photo has an overall tone-response (contrast) that makes it look faithful (maybe a little better) to the original scene. Again we get into areas of judgement call here, but as a general rule of thumb you're photo won't have good overall tone-response if the histogram is falling short of either or both corners. A compressed histogram (missing the corners) is almost always a bad photo.

Joe


----------



## mnmcote (Jun 4, 2014)

So what about manipulating the histogram to effect changes to the data?


----------



## table1349 (Jun 4, 2014)

Understanding Digital Camera Histograms: Tones and Contrast


----------



## The_Traveler (Jun 4, 2014)

mnmcote said:


> So what about manipulating the histogram to effect changes to the data?



When you change the data using curves, levels, etc, the histogram changes.
The histogram represents the sum of data of all the active layers.


----------



## Ysarex (Jun 4, 2014)

mnmcote said:


> So what about manipulating the histogram to effect changes to the data?



You manipulate the data and pay attention to the histogram to make sure that you haven't mangled the data.

Are you referring to the histogram you see on the camera or the histogram you see in editing software?

Joe


----------



## mnmcote (Jun 4, 2014)

I am talking about the histogram I see while editing...


----------



## Ysarex (Jun 4, 2014)

mnmcote said:


> I am talking about the histogram I see while editing...



I noticed from your baseball photo (different thread) that you have a Canon sx50. That camera can save an RGB JPEG or a CR2 raw file or both. What you do in editing and how you think of the histogram is going to be somewhat different depending on which of those you're working with.

Sparky who hangs out here has a good analogy for the difference. The CR2 file is all the raw ingredients you need and could typically want to cook an awesome burger. The RGB JPEG is a Big Mac handed to you through a window in the side of a building as you drive by. If you don't like the Big Mac tough or you're going to try and fix it? Seriously?! You think you can make it better? With the CR2 file nobody's going to hand it to you as you drive by -- you need to know how to cook.

1. The camera JPEG: It's already been processed. If you don't like the way it looks you should go back to the point where it was processed -- the raw sensor capture -- and get it right. If you're going to edit that JPEG what you're really doing is trying to repair an already damaged product; fix a Big Mac. Most chefs would rate your odds pretty low of ending up with a great burger if you start with a Big Mac. First, scrape off the secret sauce....

If the camera software has already done irreparable damage you start out checkmated. For example if the histogram indicates that the diffuse highlights (white ball players uniforms in the sun) have been smeared all over the right threshold wall of the histogram then the data you need isn't there. If there's no data then there's nothing for you to edit: checkmate.

Hardcore purists will insist that it's always wrong to edit a camera JPEG because you can't avoid ancillary damage created by the compression grid when you manipulate it. It was designed not to be manipulated. Now while I wrote that a million people just did it and before I finish this post millions more will do it. A lot of them will sell the result (McDonald's sells Big Macs). The damage caused by editing a JPEG starts out pretty minor and if you're reasonable about it, the convenience of shooting a JPEG and making a few tweaks later versus processing a raw file can save you considerable time.

*Critical:* You need a JPEG with as much data as possible. It is therefore essential that you have the camera skills and are familiar with your camera's processing software so that you don't get checkmated from the start (two paragraphs above). You begin by examining the histogram and you're first concern is that it extend over the full range from left corner to right corner without breaking the threshold limits. If it doesn't reach the two corners a Levels correction will repair that. In making the edit you must do as little damage as possible and DO NOT LOSE DATA. Losing the data you already have can't be a good thing -- you're manipulating it not discarding it.

Once the histogram extends over the full range of the graph you assess the tone-response of the photo. Is it too light or too dark? Does it need more contrast. Levels and/or Curves and various contrast controls will allow you to adjust that. (Don't know what software you're using).

2. A camera raw file (CR2 in your case): My favorite analogy here is a ruler and a yardstick. A one foot ruler is your finished RGB photo which would include the camera JPEG. This is the photo that will print. This is the photo in which the histogram is really a graph of your data processed for output where the left corner black really is black ink and the right corner white really is white paper. The blackest ink on the whitest paper is a fixed and limited range. The histogram reflects that and let's think of that as a one foot ruler -- a fixed data set -- 12 inches. The sensor in your camera can record 36 inches. It's actually a pretty close analogy, depending on your camera model, it's sensor records between 2 to 3 times as much data as your output target is limited to. If you're using a camera raw file you've actually got too much data or rather more data than you can stuff onto the ruler. The process of editing a raw file is managing the reduction as you take 30 inches of data and make it fit into that 1 foot histogram.

In this case the software you're using is showing you your final output histogram and it's helping you adjust the data to fit. The difference is that, until you push the commit button you're plugged into the full 30+ inches that the sensor recorded. You have to end up in the same place: a final RGB output file but you're working with a whole lot more original data and the raw conversion software is engineered to assume as much and help you take advantage. You're seeing the same histogram and your ultimate goal is the same. You generally want to see a histogram that extends corner to corner and does not slam up against the right threshold wall or pile up too much against the left threshold wall.

Joe

edit: I got carried away.


----------



## snerd (Jun 4, 2014)

Very good explanation, Joe. So, in wanting corner to corner coverage, how does "shooting to the right" figure into this? Can images be exposed to the right while still having corner-to-corner coverage?


----------



## pgriz (Jun 4, 2014)

It helps to know what your dynamic range (of the camera) actually is.  In my case, I've tested my camera and know that I have about three stops of latitude of overexposure, and four stops of latitude underexposure (ie, 7 stops total).  If I have my highlights exposed so that they are at most 3-stops overexposed relative to my "proper" exposure, and the scene has 7 stops of dynamic range, then I know that setting an exposure that puts my highlights at 3 stops over, I will still be able to fill the histogram without clipping.


----------



## mnmcote (Jun 5, 2014)

Ysarex said:


> mnmcote said:
> 
> 
> > I am talking about the histogram I see while editing...
> ...




Love the 'Fixing a Big Mac' statement.. I totally hear you...  I've come to the same conclusion while looking at the histograms of many of my photos... It's really important to get a "good" shot instead of trying to fix a poor shot. I'm still learning... And really.. I'm enjoying the process..  Thanks for taking the time to lend your thoughts... Much appreciated...


----------



## rudimaes (Jun 5, 2014)

Here you find a document 'Understandig Histograms':

http://www.creativephotobook.co.uk/pdf/histograms.pdf

Rudi


----------



## Ysarex (Jun 5, 2014)

snerd said:


> Very good explanation, Joe. So, in wanting corner to corner coverage, how does "shooting to the right" figure into this? Can images be exposed to the right while still having corner-to-corner coverage?



Yes.

I really wish ETTR wasn't called ETTR. "The right" in the term refers to "the right" of a histogram. The problem is most people think in terms of the processed RGB histogram. So there's massive confusion over what ETTR really means and it derives from misunderstandings about how histograms relate to sensor exposure. Almost every photographer has seen an RGB photo histogram but most of those photographers have never seen a sensor histogram. ETTR should refer to a sensor histogram and not the histogram of a processed RGB photo.

This really creates a mess behind the camera because cameras only display processed RGB photo histograms and yet I could go right now to Google and find a bazillion blog posts and articles explaining how to use ETTR by looking at the camera histogram -- mass confusion. NO! That's not how it works!

The point behind ETTR is that you want to take full advantage of the camera sensor's recording capacity. Think of the camera sensor as having two ends, one end gets no exposure and then exposure increases as you progressively move to the other end until you reach maximum exposure, the sensor is delivering an electronic signal. That signal gets stronger and cleaner -- the data gets less noisy -- as you move from the no exposure end to the max exposure end. We want the data on that max exposure end for best results. It's a waste not to use the full capacity of the sensor and fail to reach that max exposure end.

We also want to use the full capacity of the sensor when the scene has a high contrast range. Note Paul's previous post where he mentions knowing his camera's dynamic range recording capacity. He's talking about the sensor's recording capacity. (While mentioning Paul's post let's also note how he talks about testing his equipment: *YES!!!*) In this situation we're taking advantage of the sensor's ability to record as much tonal data as possible. This gives us an advantage in processing because we can manipulate all that data to achieve the best possible end result. When making a recording more data is good.

*All of this talk about ETTR and sensor recording ranges etc. presupposes that we're shooting and processing raw files. It does not apply if we're shooting and using camera processed JPEGs.*

The processed RGB photo histogram is a graph of the processing job and not a graph of the sensor data. A processed RGB histogram can indicate poor or faulty processing when the sensor data is just fine.

There I go getting carried away again. The point: When making ETTR exposure decisions and when assessing an ETTR exposure it's a mistake to reference the processed RGB histogram.

Joe


----------



## KmH (Jun 5, 2014)

Photo Editing Tutorials

Optimizing Exposure

http://wwwimages.adobe.com/www.adob...e/en/products/photoshop/pdfs/linear_gamma.pdf

http://www.lumita.com/site_media/work/whitepapers/files/pscs3_rendering_image.pdf


----------



## snerd (Jun 5, 2014)

KmH said:


> Photo Editing Tutorials
> 
> Optimizing Exposure
> 
> ...



From one of them.......................



> ......... If you think about it, the complex TTL metering systems that  manufacturers have built into cameras for the past 60 years are all but  obsolete. A live-view histogram-based auto-exposure system is all that  needed to generate the best possible exposure from a technical  perspective.....


----------



## Ysarex (Jun 5, 2014)

snerd said:


> KmH said:
> 
> 
> > Photo Editing Tutorials
> ...



That would be great if the camera manufacturers would build it into our cameras. I'd like to have that, but right now it doesn't exist in any modern digital camera. There is a kludge option available called UniWB but it's a pain to implement and use.

Joe


----------



## greybeard (Jun 18, 2014)

It is basically telling you exposure information about the last frame you shot.  I try to keep the "hump" in the middle but, most importantly not letting it pile up on either end.  If it is piled up on the far right side then it will be over exposed and will loose detail in the highlights.  If it is piled up on the far left side then it is under exposed and will loose detail in the shadows.  Back in the "bad old days" of shooting slides, every shot was a crap shoot so I often would shoot a 5 frame bracket of something really important.  The histogram eliminates this problem.


----------



## Ysarex (Jun 18, 2014)

greybeard said:


> It is basically telling you exposure information about the last frame you shot.  I try to keep the "hump" in the middle but, most importantly not letting it pile up on either end.  If it is piled up on the far right side then it will be over exposed and will loose detail in the highlights.  If it is piled up on the far left side then it is under exposed and will loose detail in the shadows.  Back in the "bad old days" of shooting slides, every shot was a crap shoot so I often would shoot a 5 frame bracket of something really important.  The histogram eliminates this problem.



This only applies to the camera processed JPEG. It does not apply to the raw capture.

Joe


----------



## greybeard (Jun 18, 2014)

Ysarex said:


> greybeard said:
> 
> 
> > It is basically telling you exposure information about the last frame you shot.  I try to keep the "hump" in the middle but, most importantly not letting it pile up on either end.  If it is piled up on the far right side then it will be over exposed and will loose detail in the highlights.  If it is piled up on the far left side then it is under exposed and will loose detail in the shadows.  Back in the "bad old days" of shooting slides, every shot was a crap shoot so I often would shoot a 5 frame bracket of something really important.  The histogram eliminates this problem.
> ...


I shoot Raw, seems to work OK for me.


----------



## table1349 (Jun 18, 2014)

Doesn't always work that way.
*Histogram: photography cheat sheets for achieving perfect exposure | Digital Camera World - page 4*


----------



## Ysarex (Jun 18, 2014)

greybeard said:


> Ysarex said:
> 
> 
> > greybeard said:
> ...



Works OK is a good description. Typically your raw file can handle more exposure than the JPEG histogram indicates. So the raw is often better exposed and without clipped highlights when the JPEG histogram is indicating clipped highlights. The point is it's not a histogram of the raw file. How much this really matters is when the discussion gets fun. If you're trying to squeeze as much out of your sensor as you can get in a high contrast scene then it matters, otherwise works OK is OK.

Joe


----------



## pgriz (Jun 18, 2014)

As Joe alludes to, there's not a direct relation between the histogram showing at the back of the camera, and the RAW data.  It took me a while, but after doing some careful testing, I have learned that the RAW dynamic range of my camera is about 4 stops over and about 6 stops under, giving a value of about 10.  However, the raw conversion to jpg (in camera) gives an apparent range of only about 7 (3 over, 4 under).  It's this converted JPG that we see on the back of the camera, and on which the histogram is based.  By shooting within the confines of the histogram (which is based on the JPG conversion, even if I shoot RAW), I know I have, if I need it, another stop of overexposure and 2 stops of underexposure capability buried in the RAW data.  Therefore, while I use the histogram to give my self some useful info in terms of overall exposure, I also know that if I needed it, there is still some usable signal in the lower and upper ranges that the conversion effectively throws away.


----------

