Sunday, December 31, 2006

More on Contrast

The topic before the house is HDTV contrast — see Contrast Ratios, Pt. I and Contrast Ratios, Pt. II. In the first of those posts I discussed sequential contrast ratio, the ratio of a TV's luminance when reproducing a full-screen peak white signal to that for a full-screen reference black signal. When peak white appears alongside reference black in a single checkerboard image, metering the two gives the more realistic simultaneous contrast ratio, also called ANSI contrast.

ANSI or simultaneous contrast is always much lower than sequential contrast. For instance, the Sony Bravia KDL-40XBR2 HDTV that I recently purchased has (Sony says here) a sequential contrast ratio of 7000:1. Yet the ANSI checkerboard method measures its simultaneous contrast ratio at just 1300:1.

The second post cited Charles Poynton's book Digital Video and HDTV Algorithms and Interfaces to show that a simultaneous contrast ratio as low as 100:1 will produce a fine picture. The eye at any particular moment, adapted as it is to ambient lighting conditions, responds to at most a 1000:1 luminance range. Yet the compression of luminance highlights in a video signal (an aspect of what Poynton calls "gamma correction," "nonlinear image coding," or "tone scale alteration") makes 100:1 fine for TV viewing.

Those two contrast ratios, sequential and simultaneous, are objectively measurable. But some aspects of TV contrast that are not as precisely quantifiable — they're subjective, although the science of human vision does give us some handle on them. Some of these aspects have to do with the effects of ambient lighting conditions on how we perceive a TV picture.

Just as the eye can adapt to different lighting conditions, HDTVs can be watched in pitch-black conditions at night and then again with daylight streaming in the windows the next morning. That they have full on/full off contrast ratios that vastly outstrip the eye's own 1000:1 contrast latitude can help make these TVs adaptable to such widely different conditions.

When you turn the lights out and watch TV in the dark, you can obtain a 100:1 contrast ratio by simply:

  • turning down the TV's brightness control such that image information just above reference black remains barely visible, and
  • turning down the TV's contrast or picture control until peak white is displayed at a luminance that happens to be 100 times brighter than the reference black level

Later, when there's a lot of ambient light in the TV room, the same 100:1 simultaneous contrast ratio can be obtained by boosting both the TV's brightness control and contrast/picture control in tandem.

The subjective contrast of the result, though, will not necessarily be that of the picture under pitch-black viewing conditions!

One reason for the difference is the so-called surround effect (p. 82). The human eye's sensitivity to small brightness variations increases, says Poynton, "when the area of interest is surrounded by bright elements." Conversely, when viewed in a so-called "dark surround," a scene's apparent contrast subjectively flattens out — as does the apparent vividness of the colors.

Moreover, luminance levels produced by a typical TV screen are much, much lower than those in real-life scenes. That, too, causes contrast and color to seem lower than in the original scene ... unless the TV signal is pre-compensated, in the camera, for the effects of low display luminance.

That's one of several reasons why TV signals are subjected to "nonlinear image coding." During so-called "gamma correction," by introducing what Poynton calls "tone scale alteration" into the camera's output signal, nonlinear image coding compensates for, among other things, the the effects of dim or dark viewing conditions and of low display luminances on the human visual system.

The capacity of the eye for adapting to variations in the level of light surrounding an object being viewed compensates for the tendency of light from a "bright surround" to spill into interior details of a scene and wash them out, absent any adaptation, both contrast- and color-wise. When our caveman ancestors were spotting game in a patch of shade surrounded by noonday glare, that surround-effect adaptation was a big help.

These days, when a TV is being watched with the lights off, its screen has in effect a "dark surround." As a result, apparent contrast in the image is lower than actual, measurable contrast. Likewise, the apparent strength of colors is reduced below their objective level in the original scene.

If the same TV is later watched in a brightly lit room, raising its brightness and contrast/picture controls can restore the visibility of just-above-black scene elements while holding the image's actual contrast ratio at 100:1.

Yet the presence of a bright surround now makes apparent contrast higher than before — and colors seem more vivid, too.

This is why Poynton puts such great emphasis on "rendering intent." Among other things, the rendering intent at the time the image is encoded takes into account how dark or bright the ambient lighting is expected to be in the room for the display device.

If a display is to be viewed on a computer in an office with bright fluorescent lights, images will be encoded for only moderate contrast depth, since the eye will furnish its own apparent contrast due to the surround effect.

Images to be displayed in dark, movie-theater-like surroundings need correspondingly more contrast depth in their nonlinear video encodings.

Images intended for dim-but-not-dark surrounds need to be encoded with intermediate contrast depth.

Here, contrast depth refers not to the ratio of peak white to reference black at the extremes of the TV's tonal scale, but to how luminance levels between reference black and peak white are presented, relative to one another.

In the two pictures below, contrast depth is higher in the one on the left than in the one on the right. This is so even though the darkest parts of the two images are equally dark and the lightest portions are equally light.

Contrast depth higher
Contrast depth lower

Contrast depth depends mainly on the "end-to-end power function" used to accomplish so-called "tone-scale alteration" in the encoding of a video signal or computer image, and the restoration of the original tone scale in the image's eventual display (see pp. 83-86).

The luminances between reference black and peak white in the signal must be altered as the image is encoded as, say, an HDTV signal or a JPEG file. Then they must be altered again as the TV or computer decodes the signal.

The latter duty is accomplished by the TV's or computer's "gamma" function. The former happens in the video camera, scanner, etc. When the two tone-scale alterations are combined, the resultant end-to-end power function makes the picture look right under assumed lighting conditions.

Specifically, a video camera subjects the various luminance values in the incoming image to a "power function" whose exponent boosts lower luminances (corresponding to darker scene elements) at the expense of higher, brighter luminances. This is gamma correction. Looked at another way, higher, brighter luminances are heavily "scrunched" or compressed, while darker portions of the scene are not as compressed.

The TV's own internal "power function" has an exponent as well: gamma. Gamma causes the lower-level luminances to be compressed more than the higher-level ones — the opposite of what happens in the camera.

If the camera's gamma-correction exponent is the exact inverse of the TV's gamma exponent, the end-to-end exponent (the product of the two) is 1.0. That would provide too little apparent contrast under most conditions. The denominator of the camera's gamma-correction exponent must accordingly be decreased to provide more contrast depth on the TV screen and more apparent contrast at the eye.

For example, the standard value of a TV's gamma exponent is often taken to be 2.5. If the exponent in the camera is 1/2.5, the end-to-end exponent is exactly 1.0. That's too low. If the exponent in the camera is adjusted to, say, 1/2.2, the end-to-end-exponent is now 2.5/2.2, or roughly 1.1. That gives more contrast depth and more apparent contrast under typical lighting conditions.

Precisely how much the denominator of the camera's encoding exponent (a.k.a. "encoding gamma") ought to be decreased depends on the intended lighting conditions under which the image is to be viewed. For pitch-black surrounds, for example, overcoming the apparent contrast deficit owing to the surround effect necessitates an end-to-end power of fully 1.5. 1.125 works best for bright surrounds, Poynton says, and 1.25 for dim-but-not-dark rooms (see table on p. 85).

The intended lighting conditions for TV watching are usually considered to be a room with dim, but not pitch-black, ambient lighting. If the lights are turned all the way off, as they are in many home theaters today, then the usual end-to-end power function of 1.25 is typically too low to produce enough contrast depth on the display and enough apparent contrast at the eye.

Luckily (see pp. 84-85) the fact that the TV's brightness control is (presumably) turned down below its usual daytime level when the room lights are turned off helps compensate for this problem. When a TV's brightness control is lowered, the TV's gamma — its tendency to boost contrast depth — effectively goes up. That in turn raises the effective end-to-end power function of the signal path from camera to screen, producing more apparent contrast at the eyeball.

All that tweaking of the TV's brightness control is fine if the "night" setting of that control — the one you use when all room lighting is off — produces an ideal picture under such conditions. But often it doesn't.

Lowering the brightness control can increase the TV's effective gamma exponent. That's good; it boosts contrast depth by raising the exponent of the end-to-end power function, thereby enhancing the eye's perception of apparent contrast.

But the contrast depth boost can come at the expense of potentially hiding or "swallowing" shadow detail. Elements of the image whose luminance is just above reference black can, in effect, disappear when the brightness control is turned too far down.

This is one reason why the latest HDTVs now feature a gamma control. It allows you to manipulate the TV's effective gamma exponent at will, to boost or reduce contrast depth without affecting black level in the way that the brightness control does.

The gamma control, unlike either the brightness control or the contrast/picture control, has no effect on the TV's simultaneous contrast ratio. You can tweak brightness and contrast/picture to (1) set black level and (2) adjust simultaneous contrast, the ratio of peak white luminance to black-level luminance. Then you can dial in the appropriate contrast depth with the gamma control. The result can honor the rendering intent of the program's author — even if you aren't viewing the program under intended lighting conditions.

The availability of a gamma control or other controls that affect contrast depth is a currently underappreciated feature of today's digital HDTVs. TV owners have more familiarity with the brightness control, which sets black level, and with the contrast/picture control, which sets the level of peak white. The latter control also proportionately raises or lowers the output level of all luminances below peak white and above reference black — but it does this without altering gamma/contrast depth.

These other, newfangled controls can tailor contrast depth per se, doing so without altering the luminance levels of reference black or peak white. They, along with the familiar brightness control and contrast/picture control, give us greater flexibility to adapt the measurable sequential and simultaneous contrast ratios of a digital HDTV, and to give the optimal contrast depth under actual viewing conditions.

No comments: