Contents

Understanding Image Histograms and Curves

Histograms

Image Histograms

Color Channels

Histograms and Pixel Structure

Local Histograms

Using Histograms as a Scanner Tool

Prescan Histograms

Postscan Histograms

Evaluating Histogram Area

Image Exposure and Tone Curves

The Scanning Process

Changing Brightness and Contrast

Color Corrections

Examples

Summary

Interactive Demos

Setting Exposure

Setting Image Curves

Appendices

The Photoshop Levels Function and Curves

Why Is There No Luminosity Tool?

Average Skin Tone

Using Histograms to Track Scanner Performance

Further Information

Order Hardcopy Version

Home page

The Scanning Process, Exposure, and Tone Curves

You modify the brightness and/or contrast of an image by specifying a tone curve.

An Overview of Specifying Scanner Exposure

Before we examine curves, however, I would be remiss in pursuing our objective of getting quality scans if I didn't put tone curves into the context of setting overall scanner exposure.

The myriad controls that the Nikon LS, for example, has to set exposure -- tone curves, analog gain, brightness and contrast sliders, eye droppers, prescan, 'cont', etc. -- can at first be confusing and intimidating. How, when, and why do you use them? You can make sense of these controls if you conceptualize the scanning process as occurring in what I call the pre-scan, scan, and post-scan stages, and if you consider that a scanner operates in a world of continuous (the analog domain) and discrete numbers (the digital domain).

Pre-Scan

The operator sets the operating conditions (luminance of the LEDs, film frame rotation, film flatness, even cleaning the film, etc.) so that the scanner maximizes data capture from the image. Insofar as this tutorial is concerned, however, this means matching the tonal range of the image to the scanner's tonal sensitivity range. You want to illuminate the image such that the range from the darkest to the lightest meaningful values that you want to capture match the extremes of the scanner's sensitivity for dark to light tones -- setting the black and white points. Of course you can do this in post-scan using curves, but How a Tone Curve Works shows the cost of using a curve: the histogram is expanded causing gaps; data are lost. To do this on the Nikon LS the 'prescan' is performed to get the scanner's guess of the black and white setting. Then the user may use the analog gain controls to move the base of the histogram curve to meet the white or black point. If it is possible for the operator to set the black and white points in this stage, the scanner will be able to obtain samples from all 256 intervals and all will be meaningful. Operations in this stage are manifestly analog operations.  (If you're technically minded, this stage forms a continuous function that the scanner samples.  You define the domain (the meaningful tones) of this function such that it maps precisely into the range of the scanner's optical sensitivity.  This will result in a sample for every possible tonal value.) 

Scanner Exposure -- Getting It Right

Scan

The scanner takes readings from the film and converts (quantizes) them to digital values.  User specified settings that have effect are bits/color channel (8, 12, or 14) and scanning resolution.

At this point the image's tones have been digitized into a range of discrete numbers.

Post-Scan

The scanning program applies the tone and color curves that the user has specified to the set of numbers that the scanner read from the film. Applying adjustments at this stage has the advantage of greater flexibility, but since discrete numbers are being manipulated, the cost may be distortions in the data.  Areas with increased contrast will develop gaps and possible posterization.  Areas with decreased contrast will develop loss of tonal separation.  Besides tone curves, eye droppers, sliders, and 'auto' function in this stage. These are all digital operations and may be applied outside of the scanning session without affecting the quality of the scan.

If a more extensive tone control tool repertoire is required, an alternative is to specify the tone curves in an image editor such as Photoshop, save them, and load them back into the scanning program.  If this approach is anticipated, it may be more convenient to access the scanner through the image editor's Twain interface.

It is after the post-scan stage that further adjustments are made (e.g. analog gain, curves), and another scan is performed.

To be more specific, scanner exposure controls are set in the following order:

  1. Run autoexposure to get tentative black and white point setting (analog adjustment)
  2. Use analog gain (if necessary) to get a more precise black and white point setting (analog adjustment)
  3. Make the digital setting of the black and white points
  4. Specify tone curves (digital adjustment)

These 4 steps set the black and white points, set the color balance, and allocate tonal range between the subject and background. 

By putting adjustments up-front, in the pre-scan, you don't have to apply them in the back-end, in the post-scan, where distortions may occur.  Books have been written about analog to digital conversation processes, so to keep it simple, I'll summarize this section with one rule:

Perform as many exposure adjustments as possible in the pre-scan and as few as possible in the post-scan

Setting the Black and White Points

What You're Trying to Do with A Scanner Tone Curve -- The Objectives

Now let's return to tone curves.  The scanner displays the histogram for the input image, and by specifying a tone curve you modify those tones so that they take on the values you desire.  To determine the effect of the tone curve on a tonal value project its value vertically from the input axis until it intersects the tone curve.  At the point of intersection move left horizontally until it intercepts the vertical axis.  The new values are reflected in the histogram for the output image and give the user feedback.  

How a Tone Curve Works

If a histogram bar is shifted to the right, raising it in value, the pixels in the bar are lightened.  If it is shifted to the left, lowering it in value, the pixels in the bar are darkened. 

In general you want to specify a tone curve that

bulletMinimizes breaks in tonal continuity Discussion
bulletEmphasizes the subject elements by allocating them more of the available tonal range. This comes at the expense of the tonal range of less important image elements. Case study

If you've performed the scanning procedure properly, all global settings to tone and color will have been performed during the scan.  Think of the final scanned image as a resource for current and future applications, not just the immediate present.  If all of these global adjustments are incorporated in the final scan, you won't have to do rescans and subsequent uses of the image will merely require small local tonal changes.

Properties of Tone Curves

Tone curves (Tone Curve Characteristics) have several important characteristics and restrictions:

bulletThe horizontal and vertical axes are both numbered 0 to 255, taking whole values only
bulletThe end-points are always the lower-left (0, 0) and the upper-right (255, 255) corners of the chart.  This means the overall angle, or prevailing slope, of the curve is 45º
bulletThe horizontal axis represents the tones of the source (input) image.
bulletThe vertical axis represents the output image
bulletThe tone curve is continuous -- a tone curve with gaps or breaks cannot be specified

The curve, defined by the user, shifts the bars (i.e. counts of pixels) in the histogram to their desired positions.  If in the process of shifting the bars two or more bars have the same value, they are then aggregated into one bar. For example, if the curve causes several bars to fall into the range 32.5 inclusive to 33.5 exclusive, then all of those bars are aggregated into the value 33.  Obviously this represents a loss of information to be avoided.

Remember how emphatic I was about maximizing the use of the tonal space in the previous section?  The user is rewarded for achieving this with greater flexibility in applying curves because the tones are more precisely defined.

Using Histograms as a Tool 3  Modifying Brightness and Contrast