Return to
Directed Tutorials
page.

Pete Bauer on Photoshop
Using the Histogram to Improve Curves

One of the ways that some experienced Photoshop instructors and writers separate Photoshop users is by how they perform general color correction in images. According to the "formula," Beginners use Brightness/Contrast, Intermediates use Levels, and Pros use Curves. Let's add a new category, and let's add you to it: Photoshop Color Correction Gurus use Histograms.

"What?" you ask, "a use for the Histogram? I don't believe it!" Trust me, there's a use -- a good use -- for everything in Photoshop. (For example, see my debut column "Happy to be Here!" to read a practical use for the universally-ignored Smart Blur filter.) Eventually, I hope, we'll cover them all.

When working with the Histogram to make corrections in Curves, it's important to understand what it represents. The Mean, Median, and Standard Deviation we can pretty much leave to the real statisticians. That left-hand column is more than we need for Curves adjustments, except for the last number. Pixels tells us how many actual pixels there are in this image. In this case the dimensions of the image are 477x285 pixels, which, when multiplied together, confirms that there are 135,945 total pixels. The right-hand column under the Histogram is of much greater interest to us. These numbers will change depending upon the location of the cursor. When the cursor is outside the graph, they are black. Inside the graph, they show the values for that particular level.

photo with histogram overlay (CAPTION: Pixel distribution in the Histogram.)

What we are particularly concerned with are the distribution of pixels at various Luminance levels. (Remember that the Histogram can show individual channels as well, but we're interested in the overall distribution.) There are, as you may know, 256 levels of Luminosity in Photoshop. You'll also see that number for 8-bit color and for each channel in 24-bit color. 256 is one of Photoshop's "magic numbers." The Level field in the right-hand column tells us which Luminosity level is being explored; the Count field tells us how many actual pixels are at that level. (The Percentile can, for these purposes, be grouped with the "statisticians-only" numbers ... we're sticking with raw counts as represented by the graph.) Note also in the Histogram box that the Cache Level is at 1 -- that will be discussed in a moment.

You can move the cursor horizontally anywhere in the graph, it doesn't have to be in the black area. The readings will show you which of the 256 levels you are checking, and the pixel count at that level. We are particularly concerned with ranges of levels that have far more or far less than the average distribution of pixels. Since 135,945 (total pixels) divided by 256 (levels) equals 531, any level that is significantly above or below 531 requires some correction. (If every level was at 531 for an image of this size, we'd be looking at a perfect gradient between black and white.)

It's also important that the Histogram be accurate. Therefore, we have to check one of the Preference settings. Open File> Preferences> Image Cache. (In Photoshop 6, Preferences move to the Edit menu.) Uncheck the box Use cache for histograms. The cache is a low resolution copy of the image stored by Photoshop to speed screen redraw. In most cases, you want to see an accurate update as you work. While you've got the Preferences dialog box open, drop the number of cache levels to 1 (the lowest). If you use the cache for Histograms, you'll not get an accurate depiction of the pixel distribution.

Image Cache dialog box (CAPTION: Change the Image Cache preferences to reduce reliance on the low-res cache images.)

Open an image that you'd like to correct using Curves. Use the menu command Image> Histogram to bring up the graph. Whatever your distribution, prepare to take notes. Move your cursor through the graph's highest peaks, noting the numbers listed for the Levels and corresponding Count. This gives you a record of how many pixels the image contains at each level.

As you move your cursor through the peak, note the Level at which the pixel count rises and where it tapers off. There may be, as in this image, more than one peak. I'll also track the pixel distribution at the bright end (right) of the graph. Also note the lowest areas of the graph, keeping track of where the dips start and stop. In particular, we're looking for areas of the graph/image that contain substantially more or substantially fewer than the average number of pixels.

histogram
(CAPTION: The areas that are substantially above or below what should be an average are targets for correction.)

Once you know which areas need correction, click OK to close the Histogram. Now use the menu command Image> Adjust> Curves to open that dialog box. We'll first isolate the areas to be corrected and then make the adjustments. A correction to a segment of the graph between two points will not only affect that segment, but will create an S-curve beyond the two points. That curve actually continues to affect the entire graph, regardless of the number of points. Remember that you can have a maximum of 16 points on the Curves graph.

Curves dialog box
(CAPTION: Change from a four x four grid to ten x ten by Option-clicking (Mac) or Alt-clicking (Windows) anywhere in the graph.)

Once you've clicked on the graph to set a point, you can hit Tab to enter values numerically. "Input" refers to the actual level at which you want to make changes. It ranges from zero to 255. Lowering the number moves the point to the left. Points cannot be closer that four levels. "Output" is the change you want to make. When the Input and Output number match, no change is made. When Output is raised, the pixels at that level are lighted; when Output is lowered, the pixels are darkened. With a point on the graph active, the arrow keys can also be used to change values.

The areas that have very large numbers of pixels (the shadow areas in this case) need to be adjusted upward in the Curves graph. This takes that huge number of very dark pixels and lightens them up. Using a curve like that shown below can alleviate heavy shadows. Adjusting overly bright areas of the graph downward can bring detail back to highlights.

image with Curves overlay
(CAPTION: The corrected Curve and its result. Remember that Curves can be adjusted one channel at a time, too.)

Looking at the Histogram after correction shows a radically different graph. Notice the improved distribution of pixels, with no extreme peaks. More of a

Histogram dialog box
(CAPTION: Comparing the Histograms shows the changes.) By examining the Histogram we know which areas of the image need to be adjusted. Those levels with extraordinary concentrations of pixels will appear as peaks in the Histogram. Bring them into line with Curves.


SIX SHOOTERS: --One of the changes to Photoshop 6 affects Mac users only: The Preferences file returns to the Preferences folder within the System folder. --The most noticeable change in Photoshop 6 is the Options bar. This floating palette, which can be docked at the top or bottom of the screen, combines the Options palette and, when appropriate, the Brushes palette. Very convenient access to each tool's options. Remember how Tab hides all palettes, including the Toolbar, but Shift-Tab leaves the Toolbar visible? In Photoshop 6, Shift-Tab will also leave the Options bar available.

Brushes dialog box
(CAPTION: The Options bar has been shorten to reduce the width of the image.)


 

 

 

 

 

   Copyright 2000 KW Media Group. Photoshop is a registered trademark of Adobe Systems, Inc.