Colorimetry, CIE XYZ and sRGB

Continuing my little exploration about color spaces and colorimetry... (cf previous article).

The light reaching a photoreceptor (retina or camera sensor) is called the radiant flux. It can be described by its SPD (spectral power distribution). This is a function of the wavelength, returning a power in watt (joule per second) per unit area. Standard SPDs have been specified to describe standard illumimants (the sources producing the radiant flux). These are the CIE standard illuminants. One particularly important standard illuminant is the D65 illuminant. It corresponds to the daylight at noon and is widely used as the reference 'white' light. The SPD for D65 are given here by increment of 1nm, and the CIE recommends to linearly interpolate if greater precision is necessary.

The standard SPDs are 'relative' SPDs: they are normalised to return a given value (usually 1 or 100) at a given wavelength (I've seen 560nm or 555nm). They are relative because they represent a profile, the absolute value, in watt per unit area, reaching a photoreceptor depends on the intensity of the illuminant, its distance to the photoreceptor and the size of the photoreceptor. The 555nm wavelength is choosen because it corresponds to the wavelength at which the human retina gives its maximum response (in daylight).

To represent the color reaching the photoreceptor according to the trichromatic theory, the product of the radiant flux with three color matching functions (CMFs) is integrated over the visible spectrum (from 380nm to 700nm). These CMFs \(\bar{x}\), \(\bar{y}\), \(\bar{z}\) are called the CIE standard observer and can be approximated with a sum of Gaussian functions. This gives the color in XYZ color space: $$ \begin{array}{l} X=\int_{380}^{700}SPD(\lambda)\bar{x}(\lambda)d\lambda\\ Y=\int_{380}^{700}SPD(\lambda)\bar{y}(\lambda)d\lambda\\ Z=\int_{380}^{700}SPD(\lambda)\bar{z}(\lambda)d\lambda\\ \end{array} $$

Black corresponds to (0, 0, 0) in XYZ, meaning unambiguously a SPD for the radiant flux equal to 0 over the whole visible spectrum (no light reaching the photoreceptor). On the other side, the XYZ values can become arbitrarily large, so the notion of white is ambiguous. To be able to convert from XYZ to a RGB color space, we need to choose a white point. A white point is defined relatively to an illuminant and an observer: it is the XYZ values (as defined above) for the SPD of the illuminant and the CMFS of the observer, normalised to have Y equal to an arbitrary value (usually 100). $$ \begin{array}{l} X_{white}=C\int_{380}^{700}SPD_{illuminant}(\lambda)\bar{x}_{observer}(\lambda)d\lambda\\ Y_{white}=C\int_{380}^{700}SPD_{illuminant}(\lambda)\bar{y}_{observer}(\lambda)d\lambda\\ Z_{white}=C\int_{380}^{700}SPD_{illuminant}(\lambda)\bar{z}_{observer}(\lambda)d\lambda\\ \end{array} $$ \(C\) such as \(Y_{white}=100.0\). Using the D65 illuminant and CIE standard observer I could calculate back the XYZ tristimulus values for the white point given here (95.047, 100, 108.883), and found that \(C=0.009464718742\).

To convert from XYZ to sRGB, we assume for the white point the D65 illuminant and CIE standard observer, as above, but we normalise such as \(Y=1.0\), hence \(C=0.00009464718742\). Then the conversion XYZ->sRGB is performed as described here.