Color spaces

Back to Color

An absolute color space assigns a triple of real numbers to each spectrum of light.

Theory

CIE-XYZ color space

The CIE-XYZ color space assigns each light spectrum a real number triple (X, Y, Z). This mapping has been constructed such that if we pick an idealized observer (an average human observer), then all spectra which map to the same (X, Y, Z)-triple gives the same visual sensation to the observer (assuming the same viewing conditions). Spectra which have an equal visual sensation are called metamers. The Y component corresponds to the sensation of luminance (the intensity of light). Note that luminance is linear to physical intensity of light, not to the perceived intensity.

LMS color space

The LMS color space is perhaps a more natural color space than the CIE-XYZ from the physical point of view. The LMS is an acronym of Long-Medium-Short corresponding to the types of wavelengths that the three receptors in the eye are sensitive to. By knowing the response curves of these receptors one can describe colors directly by their linear combinations. This is exactly what the LMS coordinates are for. The CIE-XYZ and the LMS space are related by an invertible linear transformation. This explains the ability of the CIE-XYZ space to identify metamers. This linear transformation has been chosen such that the Y component corresponds to luminance and that all of the coordinate triples are positive.

CIE-Lab color space

The CIE-Lab color space is a deformation of the CIE-XYZ space in such a way that the Euclidean distance between points corresponds roughly to the perceived similarity between colors, as judged by a human. In addition, one of the components is lightness which grows roughly linearly with the perceived intensity of the color. In this space

CIE-Lch color space

The CIE-Lch color space are the cylindrical coordinates of the CIE-Lab space. In this space

sRGB color space

For a long time computer monitors and image formats did not follow any standard on the used color space. This resulted in the images looking different depending on the monitor because the transmitters had different spectra. The sRGB color space was proposed and widely adopted as a default color space for such images. If an image does not specify a color space, then it is assumed to be in sRGB.

The coordinates of the sRGB color space are gamma encoded, i.e. in a form ready to be sent to the monitor. The sRGB coordinates whose gamma encoding has been undone are called linear sRGB coordinates. These linear coordinates are related by a linear transformation to the CIE-XYZ space.

HSV color space

The HSV color space is a deformation of the sRGB color space. It is an acronym of Hue-Saturation-Value. While the terms suggest a basis in color science, this is not the case and the deformation has been defined more as an aid to choosing colors. Qualitatively, the parameters act as their counterparts in color science.

The following image shows a slice through the HSV space with constant value.

The saturation varies along the y-axis from the bottom 0 to top 1. The hue varies along the x-axis from the left 0 to top 1.

Practice

Pastel provides functions to convert between:

References

Color Appearance Models, Second Edition, Mark Fairchild, 2005

Links

CIE

sRGB standard

Files

An aggregate file for color spaces

CIE-Lab color space

Roughly perceptually uniform w.r.t. Euclidean distance

CIE-Lch color space

Lightness-Chroma-Hue, CIE-Lab in cylindrical coordinates.

CIE-xyY color space

Chromaticity coordinates (x, y) + luminance Y

Color-space module

HSV color space

Hue-Saturation-Value

LMS color space

Long-Medium-Short wavelength

Testing for HSV color space

YUV color space

sRGB color space

Red-Green-Blue