Tuesday, July 05, 2005

Color Me ... a Fan of Color (Part 1)

To this blogger, one of the fine things about HDTV is how great the color in the image looks. It is at once vivid, nuanced, and sharp. It looks more cinematic than anything else I have seen on a TV screen.

There are of course various reasons why HDTV color is better than that of standard-definition TV. I'd like to explore some of them, but to a certain extent I'm held back by how daunting the subject is, technically speaking. So I intend to approach the topic with little baby steps.

One good place to begin is with a pair of articles, written by Douglas Bankston, from the archives of American Cinematographer. They compose a two-part series on "The Color-Space Conundrum." Part One is here, and Part Two is here.

"Humans can see an estimated 10 million different colors," writes Bankston, "and each of us perceives every color differently." We remember colors in real-life scenes, furthermore not as colors per se but as contexts: "A memory color is not 'green'; a memory color is 'grass'." When what we think of as "true colors" are actually contexts of personal memory, how do we bring any degree of objectivity to our use of color in scenes we manufacture, as in the movies.

One way is to describe "color spaces" scientifically. When we do that, we first need to map those 10 million different colors — their hues, their intensities of vividness versus mutedness, their values of darkness versus lightness — onto a highly conceptual three-dimensional set of axes. One of the maps we have come up with is the one experts call "the CIE chromaticity diagram."

CIE Chromaticity Diagram
The objective three-dimensional map — or, actually, a two-dimensional projection of it onto a flat piece of paper — can then be used as a point of comparison for all real-world color spaces, such as the one used in HDTV or the quite similar one used in SDTV.

Loosely, the CIE chromaticity diagram has a horseshoe/triangular shape, with red, green, and blue hues occupying the areas near the vertices. This is no accident. The retina of the human eye has three types of color receptors or "cones": one type for red, one for green, and one for blue. We see all colors in terms of these three basic colors, called primary colors.

In fact, all other colors can be thought of as mixtures of two or more of these three additive primaries. For example, there are three possible ways to mix exactly two primaries in equal amounts, leaving out the third:

  • Red + green = yellow
  • Green + blue = cyan
  • Blue + red = magenta

Yellow, cyan, and magenta are accordingly called the secondary colors or subtractive primaries. If we were to place, say, a magenta filter in front of a source of white light, what it would actually be doing is subtracting green from the light — green is the color complementary to magenta — while passing through the mixture of red and blue which we call magenta. This is why magenta (like yellow and cyan) is called a "subtractive primary."

The outer periphery of the CIE chromaticity diagram has the most vivid — i.e., purest — colors. As we move inward, away from the very edges of the diagram, we encounter all the colors that have some contribution made to them by all three primaries, red, green, and blue. At the diagram's very edge, at least one primary is always lacking. At the triangle's "corners," two primaries are lacking.

When I talk about the "edge" of the chromaticity diagram, I refer to the part of the outline that has a horseshoe or shark-fin shape. This is the so-called spectral locus. The straight line connecting the "blue corner" with the "red corner" is not part of the spectral locus. It is the line of purples. Every hue along it is a shade of purple that cannot be made by a single wavelength of light. Rather, contributions from both red and blue wavelengths are required.

3D CIE Diagram
When we move increasingly far away from the spectral locus/line of purples, we eventually get to the very "center" of the CIE chromaticity diagram. This is the area in which all three primaries are present in equal proportions, and the result is a "colorless" white. If we were to imagine moving from that white point gradually to a succession of other points located behind the page — we are now moving into the diagram's third dimension, that of depth — the white would turn first light gray, then darker and darker shades of gray, and finally black. (See diagram at right for the "Blk" point behind the two-dimensional horseshoe.)

The 3D CIE diagram shown here actually represents an LMS color space, where the L axis corresponds to the long-wavelength (roughly, red-sensitive) cones of the retina, the M axis is for medium-wavelength (green-sensitive) cones, and the S axis is for short-wavelength (blue-sensitive) cones.

Most of the time, the term "color space" really refers to a subset of the full three-dimensional CIE chromaticity diagram, a narrowed gamut or palette which, for technical reasons, typically excludes some of the purer colors on the outer regions of the diagram. It is with reference to maps like the CIE diagram that we can translate from, say, the color space used by a particular type of motion picture film to the color space used by HDTV.

Color spaces are usually defined with reference to associated sets of axes. For example, a color space defined with respect to red, green, and blue primaries uses R, G, and B as its axes and is called an RGB color space. There can also be color spaces defined with respect to (for example) X, Y, and Z axes, where X (not R) represents long-wavelength reds, Y (not G) medium-wavelength yellows/greens, and Z (not B) short-wavelength blues.

The X, Y, and Z axes, not R, G, and B, are the ones used for (most) representations of CIE-defined chromaticity. Moreover, the Y axis is identical to video "luminance." Since it is possible to transform XYZ to RGB, and (with gamut limitations) vice versa, for the most part the two sets of axes are equivalent.

There are many other color-space possibilities, but (just as the LMS color space does) they all map to the actual 3D CIE diagram, and thus to the 2D CIE diagram which is its projection in two dimensions. Accordingly, at least in theory, any color space and its associated set of axes can be mapped to any other color space and set of axes.

In practice, though, some colors that are present in one color space may not be present in another color space. In the real world, the mapping of one color space to another is not always complete. This is what I meant above by "gamut limitations." If one set of axes or color space is mapped to another, it may turn out that a particular color that is being mapped does not appear in the target color space — it is an "out of gamut" color — and so can only be approximated by a color that does appear in the target space.

For example, a deeply saturated red which is present in the color space of a motion-picture film stock may not be present in the color space used for HDTV transmissions. On even the best, most color-accurate HDTV, it will be stood in for by a slightly desaturated red primary.

More on color later, in Part 2.

No comments: