Understanding the Histogram

This is a discussion on Understanding the Histogram within the Post-Processing forums, part of the Photography Tips category; (having a good understand of how curve adjustments affect the image in a predictable way will help you to understand the examples provided in this ...


Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33
  1. #1
    Senior Member
    Join Date
    Oct 2009
    Location
    Billings, MT
    Posts
    923
    PHOTO EDITING OK
    (having a good understand of how curve adjustments affect the image in a predictable way will help you to understand the examples provided in this topic)

    Imagine some kind of creature who doesn't see photographs in terms of shades over a two dimensional area, but rather as the quantity of those shades without regard to where they are in relation to space.

    It would be kind of hard to imagine how such a creature would think of the world. But this this is really all that a computer knows about your photographs. A computer has no notion of space, it lives in this theoretical world where nothing has specific position or size, just numbers. Without it's graphics mechanism, images are just sets of numbers called "matrices" with arbitrary pointers that help tell the graphics mechanism how to describe image to us.

    Instead of mapping these data sets in a cartesian way to form pixels, the histogram maps these data sets in a way that illustrates quantity of like values.

    Histograms look at first to be something obtuse and abstract, but that is because we are not accustomed to looking at an image in terms of quantity of tones, but rather in terms of where tones are in relation to others. Once it is understood exactly what a histogram is, it's pretty easy to understand what it's telling you and make use of the data it provides.

    When I first learned photoshop, people would often have a histogram tied to an image to explain what was going on. This usually would confuse me because I kept trying to see the image in the histogram. With this on mind, i chose to try to explain the histogram not in relation to any specific photograph since, as far as the histogram goes, where the values are isn't as important as what the values are. Practical histogram analysis is also beyond the scope of this topic.

    First, the histogram is a two dimensional graph:
    [attachment=33432:Histogram.jpg]

    As with all two dimensional graphs, the up and down and sideways axes correlate to specific information. The sideways "X" axis represents all values ranging from black to white while the up and down "Y" axis represents the quantity of each of those values actually residing in the image data:
    [attachment=33433:Histogram_labels.jpg]

    In this example, there are is a large area to the left and to the right of the "mountain". What this is saying is that there are no components of this image that fall within those values. There are no pixels with values that are less than 9% grey or greater than 70% grey:
    [attachment=33434:Histogram_detail.jpg]

    [attachment=33435:Histogram_number.jpg]

    Setting the white point and black points "stretches" the appearance of the histogram by redistributing the tonal information linearly so that the darkest point is 0% and the lightest is 100% grey. In this case we like to call 0% grey "black" and 100% grey "white":
    [attachment=33437:whiteblack.jpg]

    One of the most useful things that the histogram is good for is looking for clipped information. Clipping occurs when what should be the shadow or hilight information is greater than 100% grey of less than 0% grey. Because nothing is less than 0% or greater than 100% the information simply does not exist. Here the image had been clipped intentionally to illustrate. Notice how the histogram appears to be "running off the edges":
    [attachment=33438:clip0.jpg]

    An over exposed image will often have clipped hilights:
    [attachment=33439:clip.jpg]

    When making any tonal adjustments the geometry of the of the image does not change. However the quantity of pixels bearing any one value does:
    [attachment=33440:Screen_s...58.50_AM.jpg]

    [attachment=33441:Screen_s...59.47_AM.jpg]

    Many people new to the histogram try to find geometric sense of the histogram that relates to the image. However because it contains no geometric information about where those tones exist the histogram can appear overly complicated. In reality you're looking at the same image information, only presented in a different way.

    This topic uses b/w information to simplify matters. It is important to realize that color images consist of black and white images called channels to tell the graphics mechanism of the computer how we humans see color and how to render it. Keeping this in mind, color information on the histogram doesn't significantly differ from greyscale images.
    Attached Images Attached Images          
    bear with me. i don't have an escape button...


  • #2
    Senior Member
    Join Date
    Feb 2009
    Location
    Ontario, Canada
    Posts
    1,126
    PHOTO EDITING OK
    Thank you, this is a very good explanation of what the histogram is. I am still a bit lost on what a desirable histogram looks like (besides not being clipped) and what you can do about it if it isn't good. I don't think the tonal curves you show over the histogram are available on Elements, so maybe that answer is "nothing".

    Still, a very helpful explanation.
    Marie
    Nikon D5000, Nikkor AF-S 18-55mm VR f/3.5-5.6,
    Nikkor AF-S 55-200mm f/4-5.6

  • #3
    Senior Member
    Join Date
    Oct 2009
    Location
    Billings, MT
    Posts
    923
    PHOTO EDITING OK
    I don't think there is a good "looking" histogram. It's more of an analytical thing and not something you'd want to shape into something specific. The histogram can point to some short comings and artifacts, however.

    - If there is a very sharp spike in some but not all channels, or the spike is offset, then this may indicate a color cast over a specific tonal area.
    - Overall offset between channels (such as channels appearing similar in shape but slightly to the left or right) then there is an overall color cast.
    - If there is a very sharp rise/fall in the histogram, then there is extremely high contrast in that specific region without any tonal graduation or detail.
    - Gaps indicate banding.
    - Lots of little spikes indicate noise (I'd imagine).

    I am sure there are lots of other things too. But so long as the histogram is smooth, channel information typically aligned with the median (the large peak) and without any gaps, and covering the whole tonal range without clipping the histogram is OK.
    bear with me. i don't have an escape button...

  • #4
    Senior Member
    Join Date
    Jan 2009
    Location
    Yosemite National Park California Usa
    Posts
    1,168
    PHOTO EDITING OK
    I have to agrees with the above.

    Clipping indicates loss of information. You can not recover this information by any editing process. So if your intention is to retain all that information in a scene you should try to capitalize on the histogram being exposed mainly to middle gray with the primary information radiating from the center of the histogram in light and dark directions. Most the time you'll find you don't need all the info because frankly most smooth middle gray exposure will be flat.
    But if you shoot to middle gray you should be able to edit which way want with out too much loss. And the histogram is a great tool to use making curves and levels adjustments.

    For a small experiment get a gray card shoot a picture of it set as your white balance.

    Set your aperture to say f8 in aperture priority mode 0 exposure compensation.
    Now turn down you compensation -2 ev take a picture it should apear black or really dark gray
    Now turn your exposure compensation up to -2 ev it shot appear white or really light gray.
    You must use a tripod and not change the lighting.

    Take those 3 shots to your editing program look at the histogram for the 0 exposure all the info should pretty straight up the middle. Look at the histogram for the -2 most the info should be bunched up on the left. Look at the histogram for +2 most the info should be bunched up on the right.

    Now edit the dark shot to middle appear middle gray and edit the light shot to appear middle gray. Use a eyedropper tool to sample the color it should read 128(middle value from 0 black 255 white)Look at the histograms for both edits do you see the same shaped histogram as the middle gray?????

    Likely you dark edit will increase noise and your light will have less noise but gaps in the histogram like the dark.




    Get OUT and SHOOT Y'ALL...........Sitting at the 'puter don't make better photos!!!!!!

    Some of my crappy photography on FLICKR

  • #5
    Senior Member
    Join Date
    Jun 2010
    Location
    Naples, Florida, USA
    Posts
    824
    Equipment
    Canon, Cambro/Calumet
    PHOTO EDITING OK
    Agreed to a point. If you want to retain maximum detail you need to shoot as 'white' or to the right as you can without clipping highlights and depending on the subject matter even clipping specular highlights as they are white by definition. This because 12 bit RAW files allocate 2048 levels to highlights and only 128 levels to shadow areas (8 bit JPG highlights = 69 and shadows = 20). So if you try to lift 'shadows' to 'dark' it's like trying to fill 256 levels with 128 levels of data but if you go the other way, there is a surplus of data.
    Capture all the photons you want; the universe will make more.

  • #6
    Senior Member
    Join Date
    Jan 2009
    Location
    Yosemite National Park California Usa
    Posts
    1,168
    PHOTO EDITING OK
    Very true which is why most folk's recommendation is to expose whites(push them towards white with out major clipping) to grab as much info as possible in the blacks. Or it's better to overexpose a little than underexpose. That way you maximize the stops the camera does see.

    Great post by the way to the O.P. and other contributors. This is one of the HARDEST things that new users find along the way. It's not magic just science and generally speaking close enough works pretty good.

    Where this is most handy in everyday shooting is when:

    Your in a brightly lit scene and the little display on the back of your camera lies about exposure
    Your in a dimly lit scene and the little display on the back of your camera lies to you about exposure.

    The little display is great for checking sharpness zooming in after a little practice you'll be able to identify what's sharp and composition. But use the histogram to read your exposure and make sure it is what you intended.
    Get OUT and SHOOT Y'ALL...........Sitting at the 'puter don't make better photos!!!!!!

    Some of my crappy photography on FLICKR

  • #7
    Senior Member
    Join Date
    Oct 2009
    Location
    Billings, MT
    Posts
    923
    PHOTO EDITING OK
    DS- Why is it that there are more hilight tones than shadow tones? As far as I knew the palette is distributed evenly over a 2^(bitdepth) gradient. The camera doesn't know anything about what a "hilight" is, only that the sampled analog value of any given position on the CCD is a specific current that correlates to a specific binary value. Is the placement of levels nonlinear???

    From what I always understood is that because the CCD cannot measure the absence of light, but rather the amount of light present, brighter pixels of higher analog current produce more useable signal relative to inherent noise present in the system and as a result the digital sampling is more accurate than a dark pixel which of lower analog current. This, I thought, is why slight over exposure produces better results.
    bear with me. i don't have an escape button...

  • #8

    Join Date
    Jul 2010
    Location
    Oregon
    Posts
    1,481
    PHOTO EDITING OK
    Quote Originally Posted by twinkle_turnip View Post
    (snip)
    - Overall offset between channels (such as channels appearing similar in shape but slightly to the left or right) then there is an overall color cast.
    (snip)
    T_T,
    I think you should review and re-think what you wrote (said) and I will maintain that what you said in the statement above is not the way it works. If what you say above is used then whoever uses it and corrects globally for a color cast may correct for a cast either in the shadows or the highlights that is non-existent.

    Let me explain and this is a bit more complicated but simple;
    First we must know that channels can be to the left or right (or left and right) of the edge of a histogram with no color cast existing. The cast is present and indicated only when the channels fail to run left or right at the same lengths.
    That said and to continue: The key here is the words "overall color cast" that you included in your statement. First off the majority of the color casts we get in our image will not be "overall color cast". If there are "overall color casts" then it will not be indicated "as channels appearing similar in shape but slightly to the left [b]or right" (the channel shape is not important in reading what a color cast is). An "overall color cast" would be indicated by channels appearing at different lengths but slightly to the left [b]and right. One must also note that the color cast in shadows (darks) and highlights (lights) are read in two completly different ways and if that is not properly done then the wrong color cast will be determined.
    QUOTE
    Histogram set to Luminosity;

    Dark side (left shadow side) of the color Histogram read for color cast -
    If one channel histogram doesn't extend as far to the left as the other two, you have a color cast in the dark areas of your image. So if blue doesn't go left as far as the other you have a blue cast in the shadows of the image.
    If two histograms don't extend as far as the left as the third then use this chart;
    Red+Green = Yellow color cast
    Red + Blue = magenta color cast
    Green + Blue + cyan color cast

    Highlight side (right bright side) of the color histogram read for color cast-
    If one channel histogram doesn't extend as far to the right as the other two, you have a color cast in the light areas of your image. However since you are reading highlights on the right side the color cast will be the opposite of the histogram, the image does not have enough of that color so it look like the other color.
    Lacking red = a look of cyan
    Lacking green = a look of magenta
    Lacking blue = a look of yellow

    If two histograms don't extend as far as the right as the third then use this chart;
    Red+Green = blue color cast
    Red+Blue = green color cast
    Green+Blue = red color cast

    It is up to the photographer to decide if the cast when present is desirable. If not then it is up to the photographer to decide technique to adjust for color cast and amount of adjustment. One technique such as Color Balance, Curves, Selective Color, and many others (or combos) may work well on on image and not as well on another. The best technique to use if correction/adjustment is desirable is always image dependent.

    The human eye will trick us into thinking there is a certain color of cast in an image when there may be a cast of a different color. However with practice in reading the color histogram properly we can overcome that as the histogram does not lie. It takes practice but it works and works well too!
    That quote is from one of my last two post about reading the color histogram to determine what color cast exists and where (shadow or highlight) it exists that are at the end of this thread started by Brandon ~
    Bell Over the City Thread

    KimR

    Comments and Critique are always encouraged, considered and appreciated. Thank in advance too.

  • #9

    Join Date
    Jul 2010
    Location
    Oregon
    Posts
    1,481
    PHOTO EDITING OK
    Quote Originally Posted by rockhead View Post
    I have to agrees with the above.

    Clipping indicates loss of information. You can not recover this information by any editing process. So if your intention is to retain all that information in a scene you should try to capitalize on the histogram being exposed mainly to middle gray with the primary information radiating from the center of the histogram in light and dark directions. Most the time you'll find you don't need all the info because frankly most smooth middle gray exposure will be flat.
    But if you shoot to middle gray you should be able to edit which way want with out too much loss. And the histogram is a great tool to use making curves and levels adjustments.

    For a small experiment get a gray card shoot a picture of it set as your white balance.

    Set your aperture to say f8 in aperture priority mode 0 exposure compensation.
    Now turn down you compensation -2 ev take a picture it should apear black or really dark gray
    Now turn your exposure compensation up to -2 ev it shot appear white or really light gray.
    You must use a tripod and not change the lighting.

    Take those 3 shots to your editing program look at the histogram for the 0 exposure all the info should pretty straight up the middle. Look at the histogram for the -2 most the info should be bunched up on the left. Look at the histogram for +2 most the info should be bunched up on the right.

    Now edit the dark shot to middle appear middle gray and edit the light shot to appear middle gray. Use a eyedropper tool to sample the color it should read 128(middle value from 0 black 255 white)Look at the histograms for both edits do you see the same shaped histogram as the middle gray?????

    Likely you dark edit will increase noise and your light will have less noise but gaps in the histogram like the dark.
    If I had my old hat of ten years ago on (my hat of beginning digital photography) I would not question what you have written rockhead. I lost that old hat though and would never agree with "try to capitalize on the histogram being exposed mainly to middle gray".

    Expose to the right is my recommendation for capitalizing on exposure and you can read why here ~
    Expose (to the) Right
    KimR

    Comments and Critique are always encouraged, considered and appreciated. Thank in advance too.

  • #10
    Senior Member
    Join Date
    Oct 2009
    Location
    Billings, MT
    Posts
    923
    PHOTO EDITING OK
    Thanks Kim. You're absolutely correct. I think we're talking about the "same" histogram, but your analysis is much more universally applicable and accurate.
    bear with me. i don't have an escape button...


  •  
    Page 1 of 4 123 ... LastLast

    Remove Ads

    Sponsored Links

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •