Linear and nonlinear coding


Human vision does not operate linearly. Like all perceptual systems, vision is nonlinear. Vision can distinguish two shades of grey if the ratio of their intensities exceeds about one percent. (This is Weber's law, applied to vision.)

Linear intensity coding is fine if you can afford 12 or 14 or 16 bits per component, but if you have only a limited number of bits per component - 8, say - you must code nonlinearly to get decent performance. You need to take into account the nonlinearity of vision.

Most image sensors are intrinsically linear devices, so upon capturing linear intensity data, you must subject the data to a transfer function representative of vision. This process goes by the pejorative term gamma correction. The transfer function is often characterized by a single numerical parameter gamma.

Nonlinear coding matched to human perception performs better than linear coding on any image intended for human viewing. This is recognized by PNG, JPEG, sRGB, PhotoFlash, and all of the major high-quality file formats of all the major digital photography vendors.

As far as I am concerned, my Gamma FAQ is a complete, succinct, and accurate technical introduction to the topic of nonlinear coding. But gamma is a confusing issue, so I have prepared a sequence of pages to offer a more gentle introduction.

On 1998-02-25, Timo Autiokari published, in an open letter in a Usenet posting, some inflammatory remarks concerning my FAQs. These remarks are sufficiently grave that I feel obliged to respond. You can read about the Timo incident, and you can read Timo's technical argument. You can read about Timo's links.

See also: Frequently-Asked Questions about Gamma,
Frequently-questioned answers about gamma - GammaFQA

Charles Poynton
Copyright © 1998-03-20