Controlling Color and Light in Photoshop:
Histograms and Color Curves

We have seen that our images are based on an RGB format, but that the HSL (Hue, Saturation, Lightness) repesentation corresponds to one set of controls that is natural to use (In P.E. it is found under Enhance - Adjust Color - Adjust Hue/Saturation, ctrl-U). However, working with these controls to adjust by eye can be difficult. When we print we often get a different image than we thought from the computer screen. There is an essential view of the light and color in an image that helps us understand what we are working with: the histogram.

Histograms

A histogram is simply a bar-graph of a set of numbers representing counts for different categories. For example, if we have the following student grades on a quiz, we could draw a histogram of those grade to give us a visual sense of the distribution:

                                              grade        count                                  grade histogram
            10                6
              9                5
              8                3
              7                6
              6                7
                                                 5                4
                                                 4                0
                                                 3                2
                                                 2                1
                                                 1                0
                                                 0                0

A histogram for an image is similar. The categories are the possible intesity levels for the colors red, green, blue, or the overall intensity level, luminosity. For 24-bit color as we typically use, the histogram has categories 0 to 255, where 0 is black and 255 is white or totally saturated color. Here are some examples of photographs with their histograms.

costa rica example 1    example 1 histogram

(from luminous-landscape tutorial: http://www.luminous-landscape.com/tutorials/understanding-series/understanding-histograms.shtml)

photoxels example 2 under      example 2 histogram

(from Photoxels tutorial: http://www.photoxels.com/tutorial_histogram.html)

photoxels example 3 over     example 3 histogram

  (from Photoxels tutorial: http://www.photoxels.com/tutorial_histogram.html)

photoxels example 4    example 4 histogram

 (from Photoxels tutorial: http://www.photoxels.com/tutorial_histogram.html)

The first and last of these examples are photographs that are exposed correctly. We see that the histograms are roughly centered. More important, we do not see pixels "stacked up" at either end of the range.

If we have pixels pushed to the left, as in the second example, the photograph is underexposed, at least for the shadow area. This is because the darker areas of the image are all together at level 0, black, so we cannot distinguish any details in the darkest areas; they have been lost.

Similarly, for the third example, the pixels are stacked up on the right. This means the highlights, the brightest parts of the image, have all been pushed to level 255, or white. There will be no details at all in these pixels. Photoshop or any other image processing program cannot get any detail to show when the pixels are all white or all black!

Most digital cameras can show the histogram for an image that you have taken. If it looks like the second underexposed, image, then you should be slowing the shutter speed or opening the aperture (lower f stop value). If it looks like the third, overexposed, image, then you need a faster shutter speed or smaller aperture (higher f stop value). You should try to get the histogram in range when taking your photograph, because once the highlights are "blown" or the shadows too dark, you cannot recover any detail from them.

Dynamic Range

The range of your histogram is called the dynamic range. The sensitivity of a digital camera lets it capture a dynamic range of about 5 f-stops (f-stops refer to the aperture on your camera and changing one f-stop means doubling the amount of light). People see a range of about 10 f-stops (from dim reading to bright sun on snow). Ideally, your histogram will be spread over the whole available range without pushing pixels to either the left (dark) or right (white) extreme.

Many cameras indicate the overexposed parts of an image with a flashing white area in the lcd screen. This indicates that these parts of the image are all white, and perhaps the image is overexposed.

Some scenes, like a landscape with a bright sky, may simply have too large a range for the camera to get. Either the darker details will be underexposed or the sky will be overexposed. When this is the case, more advanced techniques need to be used. The photographer can use filters that darken part of the scene, but not the whole scene. The photographer can take two images and combine them using photoshop.

Colors

We can also view the histogram for the individual colors in photoshop (and on some newer cameras). This can be helpful to see if details for a particular color are too much toward one extreme or the other. We will also look at other color adjustments below.

Exceptions

Some scenes are exceptions to the general rule. We should use the histogram as a guide to help us see what we are after, but the visual image takes precedence. For example, in a sunset, we may not care that the shadows are black -- that is not what the image is about. Here are three examples where the histogram is "not right" but the image is what we want.

breaking rules 1   breaking rules 1 histogrm  

 (from Photoxels tutorial: http://www.photoxels.com/tutorial_histogram.html)

In this example, the whole point of the image is the silhouette of the foreground against the light sky. The histogram is pushed to the two extremes. Notice, however, that some range is retained in the sky.

moon example   moon histogram

(from luminous-landscape tutorial: http://www.luminous-landscape.com/tutorials/understanding-series/understanding-histograms.shtml)

In this example, most of the image is very dark and only a small part, the moon, is light. The tiny bumps to the right of the histogram are the moon and the big peak to the left is the rest. Notice that the shadow area is not stacked on the left edge of the histogram, so we can see some detail in the dark area. This could be enhanced on photoshop.

tree in snow    tree in snow histogram

(from luminous-landscape tutorial: http://www.luminous-landscape.com/tutorials/understanding-series/understanding-histograms.shtml)

In this winter scene the histogram is entirely in the upper third of the available range. However, this corresponds to the visual image that we want; we do not want anything in the lower half of the dynamic range in this photgraph. Even though the whole image is very light, it is not overexposed. The histogram tails off before it hits the right edge of the range, so the details can be seen in the image.

Tools for controling color and light

Once we have an image loaded into photoshop elements, we can adjust the color and light that we have. We cannot recover anything from highlights that are blown -- overexposed to white -- or shadows that are all the way into black. However, we can lighten dark parts of the image, adjust highlights and adjust midtones. We can view our effect on the image quantitatively by opening the Histogram window under the Windows menu.

We have already seen the hue-saturation-light adjustments. However, these shift all elements of the image at once. The hue adjustment has little effect on the histogram because it is changing intensity among the colors to change hue without changing the overall intensity which the histogram shows. The saturation control has little effect when it is moved to the left, which simply makes the color values more equal (moving toward gray), but with the same overall intensity. Small moves to the right also have little effect. A large increase in saturation can flatten the histogram as intensities for some colors are reduced to make the dominant color stand out more.

Levels tool

Another tool, the levels tools, directly manipulates the histogram. We get this tool by selecting Enhance - Adjust Lighting - Levels (ctrl-U). The dialog box that opens shows the histogram with three sliders below it. The bottom (black) slider is used to adjust the point in the histogram where black will appear. If we move it up, the image gets darker, especially in the darkest parts. If you have the histogram window open at the same time as the levels window, you can see what is happening. The point at which the black slider is placed becomes the new zero or black point. The rest of the histogram is stretched toward it, with the end toward white anchored.

Similarly, the right slider for white adjusts the point in the histogram that will define full white. If we move it to the left, the histogram is shifted up toward white and the image becomes lighter, especially in the highlight area. The bottom end of the histogram is anchored so the histogram is stretched right.

The middle slider adjusts the point where the mid-range (128, 128, 128) will be defined. If you move it, the point in the histogram it is under will be shifted to the midpoint, with the upper and lower ends anchored. For example, if most of your histogram is above the mid-point, you may want to move this slider up, thereby making the midtones more balanced.

Another way to make adjustments with the levels tool is to use the eye-droppers to specify black, white, and mid-tone gray. First the settings for the eye-droppers must be set by double-clicking on each. Set the black to 10-10-10 for RGB , the white to 240-240-240, and the midtone to 128-128-128. (These settings will remain until you change them.) Then find the darkest spot in the image and click the black eye-dropper over it. Do the same for the whitest location with the white eye-dropper. For the midtone, try to find a neutral gray and click the mid-tone eye-dropper. These will set the colors of the spots where you clicked to be the given settings, adjusting other colors accordingly. You can see the effects on the histogram. You may then want to adjust the midtones for brightness by using the middle slider as before. This technique insures that your image uses the full dynamic range available without clipping highlights or shadows at either end.

Color curves tool

The color curves tool in photoshop is another way to adjust the histogram by working with different parts of it. It gives somewhat more flexibility than the levels tool does. Iif you need to adjust the black and white points, as we did above, then you should do this using levels before you go to the color curves.color curves

You get the color curves dialog with Enhance - Adjust Color - Adjust Color Curves, as shown to the right (image from Adobe online documentation for Photoshop Elements 6.0, http://help.adobe.com/en_US/PhotoshopElements/6.0/help.html?content=WS3216BCB6-F54C-4c4a-99A0-EBEA69F30C27.html). One of the handy things about this dialog is that it shows a before and after of your image, so you can see the effect that your adjustments are having. You also see the basic color curve at the lower right and sliders for adjusting it, bottom center. The lower left palette allows you to choose one preset adjustment, after which you can continue to adjust.

The color curve indicates what the output level, on the vertical axis, will be for each given input level, the horizontal axis. Initially, it is neutral: the output is identical to the input at all levels so the curve is a 45 degree straight line. If at a given point on this line we raise that point on the curve, then an input at this level will be brighter on the output. We have shifted that part of the histogram up. If we lower a point (as shown in the diagram to the right), then we darken that part of the image. In the diagram to the right, the point high on the curve is lowered using the "Adjust Highlights" slider; this makes the highlights in the image darker. The "Midtone Brightness" and "Adjust Shadows" sliders will do the same type of adjustment for the midpoint and lower point on the curve.

The contrast for a portion of the image is indicated by a steep slope on the curve. You can achieve this through most of the image by rasing the highlights and lowering the shadows -- the "increase contrast" preselect has this effect. You can also adjust with the "Midtone Contrast" slider. If this is moved to the right, the midtones will contrast more with the highlights. If it is moved to the left, the midtones will contrast more with the darker parts. By working with all the sliders, you can get different effects. The "solarize" preset shows what happens when you push the curve so that it goes up and down. You get an unrealistic image, otherwise known as a special effect.

Other Sources

You can find additional information at the following web sources, which were used to develop the above discussion:

Histograms.

The Luminous Landscape, Understanding Histograms

Photoxels histogram tutorial

Scott Bourne's Picture Correct

Color Curves

Scott Kelby and Matt Kloskowski, at PeachPit, Color Me Badd: Color Correction for Photographers, (excerpt from the book I use)

Earthbound Light Photo Tip of the Week, Photoshop Curves, Stepping Up from Levels (this is about Photoshop color curve, not Elements, so it has more than we can do with Elements, but it helps to understand how curves work)