A Primer on Image Histograms and Curves

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

Introduction -- "How Do I Know When to Stop?"

If you're new to using a scanner, or perhaps even not so new, the process of getting an acceptable image as well as what constitutes a final image can at first be a total mystery -- it sure was for me. A paucity of useful books on this subject only aggravates one's attempts to address one's ignorance. No matter how good appearing the scans one gets, unless one develops an understanding of the underlying concepts and principles of operation, one is left with the nagging suspicion that the final scan could have been better.

Another reason for such a measure is that if you have a high-end scanner and want that last 2% of performance -- which differentiates the scans of an excellent scanner from an average one -- you need to be able to quantify just how good each image is. Otherwise how else does one justify the premium paid for such a scanner?

“I Can Tell My Scanner Is Good Because the Results Look Great.”

You see, that was the nub of the problem.  Once one acquires a minimal competence in adjusting images one is able to adjust images scanned under a wide range of scanner settings and get acceptable results on the monitor.  I would make several scans of the same image, each with different settings, and after tone and color adjustment end up with images of apparently equivalent quality.  Which one to save?  Obviously you want to save the best one, but they all look the same.  What is needed is an objective measure of scan quality that eliminates variables such as monitor performance and the subjective judgments of tone and color adjustment.

Because I tended to use my scanner intermittently, I accumulated a pile of notes over the years. In an effort to organize and consolidate these notes, mostly for my own convenience, I decided to put them into Web pages. Hopefully these also may be beneficial to others. Basically these pages outline, more or less, the evolution of a personal approach to scanning.  

To be honest, this is not simple material, but when I reflect on how many hours I've wasted making scans, I realize that I would have saved most of those hours if I had spent just a few of them learning this material beforehand.

The Context for This Tutorial

Often a properly scanned image will look much better than an image scanned carelessly at twice the resolution.  This tutorial emphasizes a quality of data approach to film scanning over quantity (resolution).  And as a practical result, it advocates a two-step, professional-type of workflow for image production:

  1. In the scanning step, one scans for maximal data quality, i.e. capture image data as accurately possible. The resultant image constitutes the final scan.

  2. In the image production step, one or more final images are derived from the final scan in an editing program and are modified through tools such as filters, cropping, sharpening, etc. What distinguishes these final images is that they are modified to address different needs by abstracting from the final scan. A final scan with high data quality as a resource has more potential for meeting more needs.

Most amateurs and beginners attempt to accomplish all this in a single step and as a result must re-scan the image as different needs arise. If the final scan contains all capturable data, re-scanning is superfluous. This is the main theme of this tutorial. Histograms and curves are merely the tools that are used as aids in extracting every bit of data and thereby implement this approach.

Goals of a Scanning Procedure -- First Principles

To me, getting a quality scan should almost be a mechanical process. I don't mean that one works like a mindless robot; only that at each step one is able to read and interpret the diagnostic tools available and from them know exactly what to do next. Part of this requires a good scanner with software with the necessary features. The other important component is, of course, a competent operator who knows what to do.

The abiding idea the operator follows is that in scanning the name of the game is accurate and comprehensive data capture while maintaining the relationships among the pixels. If this sounds a bit dry and mechanical, I would argue that's how it should be. Having good original scans as a resource gives you more data to work with when you exercise your creative impulses later in the image-editing program. That's where you alter and make abstractions of your original scans. A good final scan may not look snappy and may not grab your attention, but it will stand-up to your manipulations in the image-processing program so that the final product does look snappy and grabs attention.

Scanner Sensitivity -- The Limiting Resource

The typical consumer film scanner reads each pixel as an analog signal from an array of charge-coupled-device (CCD) sensors, which sweep longitudinally across the film plane. An analog to digital converter translates it to an integer from 0 to 255 (in 8-bit mode) or 0 to 4095 (in 12-bit mode). This is done for each of the red, green, and blue color channels. These readings are passed to the scanner software, e.g. NikonScan, which uses a user-specified function to transform the tone and color to an output number, also from 0 to 255, which is stored in the resultant image file. Unfortunately the CCDs in non-professional scanners have a very limited sensitivity range and are often incapable of capturing all of the tonal values in an image. In addition, because they operate at the limits of their capabilities, they are susceptible to electrical noise artifacts. To minimize these artifacts and make optimal use of the limited range, the user is forced to define how the image is to be scanned by assigning weights to areas of the image.

The 256 tones are just sufficient to form a visually continuous gradient. The problem is that once the scan is made one is working with discrete (integer) values.  With each adjustment of contrast or brightness, some of those values are aggregated. After several adjustments, an area containing a smooth tonal gradation may degenerate into visibly distinct areas.

LS-2000 Process Schematic

Image Histograms

* © 2000 - 2008  by D. Kosaka.  All rights reserved