The Digital Eye: Measuring Color

When light is reflected from of an object into the human eye, it travels through the cornea, onto the retina, through the optic nerve and into the brain. It is a continuous stream of energy interrupted only by the occasional blink or by sleep. The digital camera is a mechanical replica of the eye having a lens (the cornea), a sensor (the retina) a cable (the optic nerve) and a computer (the brain).

The similarities between these two devices are pretty obvious, but the differences are profound. Where the eye sees a continuous and seamless fabric of color and tone, the digital camera divides the colors and tones into little square units called pixels. A photo-sensitive sensor uses an array of colored filters to separate light into three basic colors, red, green and blue (see Figure 1). The sensor records the strength of each color component and software assigns a numerical value to each square. The red green and blue values are then assigned to individual pixels.

Bit Depth

Each pixel contains a certain amount of information that determines its bit depth. Pixels of smaller bit depths display fewer colors. I think the best way to understand how colored light is translated into the numbers that a computer can understand is to look at the simplest color model as an example. Bitmap images (not to be confused with the Bitmap file format) contain only one bit of information.  The pixels are either black or white (see Figure 2). Computers use a binary number system to make calculations. Unlike the common decimal system we use every day which has ten characters to represent all of the numbers, (0,1,2,3,4,5,6,7,8,9) a binary number system uses just two characters: zero and one.

It helps to think of each pixel in a bitmap as a light switch. The switch is either off (0), or on (1). With only one switch, the light is either on, displaying white, or off displaying black.

Grayscale

Grayscale pixels contain eight bits of information. Simply translated into our light switch analogy, each pixel has eight switches that can be turned on or off. That means that there are a total of 256 combinations of tonal values. (28 = 256). Each gray value is assigned a number between zero (black) and 255 (white). The 256 gray values, when seen on screen or translated into printer dots, produce the illusion of continuous tone, or a black and white photograph.

A closer look however, reveals that they are a mosaic of varying shades of gray pixels (see Figure 3). Low grayscale values produce darker grays with the number zero being assigned to absolute black. Conversely, high values produce lighter colors with the number 255 assigned to white. Of course, in a 256-level grayscale, a value of 127 is a mid-tone gray.

RGB

Color images are actually composed of three grayscale channels. That may sound contradictory but the concept is rather simple. Bitmap and grayscale images contain only one channel—a single image in the Channels panel that is identical to the image on screen (see Figure 4). RGB images contain three channels that are grayscales displayed through red, green and blue color filters (see Figure 5). 

Each grayscale pixel contains eight bits of information or 256 shades of gray, as previously stated. RGB images display a multitude of variations of color. In fact, if you do the math, (3 channels of 256 variations) you get almost seventeen million colors, (2563)  = 16,777,216) which is the extent of your color palette in Photoshop or any other graphics program that supports RGB images. The as with grayscales, darker colors have lower numbers and lighter colors have higher numbers.

RGB images display full-color and are referred to as eight bit color. Photo-realistic images that consist of smooth gradations and subtle tonal variations require eight-bit color to be properly displayed.

Gray Vs. Color

When the RGB values of a pixel are all equal then the color produced will be black, (0R, 0G, 0B), White, (255R, 255G, 255B) or gray (any other numbers between zero and 255 with three equal RGB numbers), as in Figure 6. Pixels appear colored when their numbers are unequal. For example, a color with higher red numbers and lower green and blue numbers is predominantly red (see Figure 7).

Eyedroppers

The value of individual pixels or groups of pixels can be measured. Why would this information be useful? Because accurate color correction would be impossible without knowing the values of specific areas of pixels.  Pixels are measured with the Eyedropper or Color Sampler tool and the Info panel. The Eyedroppers can be configured in the Options bar to measure a point sample, or the average value of a group of pixels (see Figure 8). For higher resolution or large format images, a five by five value or greater is recommended.

Info Panel

The Info panel, found in the Window menu, displays the specific information that the Eyedroppers detect. When the Eyedroppers are dragged over the image, the numbers rapidly change as the tools touch pixels with different values.

When a pixel is sampled by the Color Sampler tool, a numbered target is deposited on the image and the data appears in a separate field. When a color or tonal adjustment is applied, two sets of numbers are displayed (see Figure 9). The number on the right is the initial sample. The number on the left conveniently changes as the adjustment is made and can be compared to the values of the original sample point.

Values of different color modes can be selected from the small pulldown menu on the Info panel (see Figure 10). I find that RGB is the useful for most color correction, however there are certain situations where other color modes such as Hue Saturation and Lightness (HSL) or CMYK are invaluable.

Histograms

While the Eyedroppers and Info panel are essential for measuring the colors of individual pixels, the histogram is the primary measurement device for determining global color trends. When you first open an image, scrutinize it carefully to determine what the colors on your monitor represent. Sometimes the on-screen image doesn’t accurately represent the image’s actual colors so it advisable to calibrate your monitor and color manage your image before making color adjustments.

Select the Histogram panel in the Window menu and observe the graph. A histogram is a graph composed of lines that show the relative distribution of tonal values within an image. The more lines the graph has, the more tonal values are present within the image. The height of a line represents the relative quantity of pixels of a particular brightness. The taller the line, the more pixels of a particular brightness the image contains. The histogram looks like a mountain range on some images, because a total of 256 tonal values can be represented at one time, and the lines are so close together that they create a shape (see Figure 11).

The dark pixels, or shadows, are represented on the left side of the graph; the light pixels, or highlights, are on the right. The mid-tone ranges are in the central areas of the graph. Furthermore, the Histogram panel can be expanded to display individual color channel information (see Figure 12).

Histogram Elements

For your information, here is neat list of a list of definitions of terms that you’ll find on the Histogram panel:

  • Mean Average: brightness value of all the pixels in the image (0–255.00)
  • Standard Deviation: The standard deviation, or how widely brightness values vary
  • Median: The middle value in the range of brightness values
  • Pixels: Total number of pixels in the image or in a selected portion of the image.
  • Level: The specific pixel value, between 0 and 255, of the position of the cursor if you place it on the graph
  • Count: Total number of pixels in the level
  • Percentile: Percentage of pixels equal to and darker than the level
  • Cache Level:  The current image cache setting

Tonal Characteristics

The histogram can tell us about the tonal characteristics of an entire image or a selected region. For example, a histogram in which the majority of tall lines are clustered on the left side of the graph and short lines are on the right side indicates that the image is dark, or low key. Conversely, a histogram in which the tall lines clustered on the right side of the graph indicates that the image is light, or high key

Histograms can also indicate deficiencies in color and contrast. For example, a histogram devoid of lines on both the left and right ends of the graph (as in Figure 13) indicates that most of the pixels are in the mid-tone range and lack highlights and shadows and are of poor contrast.

Measuring color is critical to producing vibrant, clean, sharp images that have impact. It is essential to measure color when performing color corrections like levels, curves or color balance adjustments. The human eye is an accurate device for seeing color but unfortunately the human brain imposes its subjective opinions, which can be inaccurate. The one real reason to measure color is that numbers don’t lie. What you read in the Info or Histogram panel is the indisputable truth—and that’s the best possible place to begin your color corrections.