Unit content
Color encoding and linear-light computation
Stored RGB values are often encoded nonlinearly rather than being proportional to emitted or measured light.
A transfer function allocates more code values to darker levels, where human vision is relatively sensitive to small changes. Standard display color spaces such as sRGB use such an encoding.
This distinction matters whenever colors are combined numerically. Operations intended to model light—such as averaging samples, filtering textures or blending translucent layers—should generally be performed on values proportional to light intensity, called linear-light values.
If encoded values are averaged directly, the result is usually too dark because the arithmetic is being performed after a nonlinear transformation.
A typical workflow is therefore:
- decode stored values to linear light;
- perform lighting, filtering or compositing;
- encode the result for storage or display.
The transfer function is not the same thing as display brightness or artistic “gamma correction”; it is part of the numerical meaning of the stored color values.