Colors - It's more complicated than you think

How is color space defined and what exactly is “color” from a machine’s point of view.


is closely associated with human eye perception.

The three types of cones S,M and L have different sensitivity curve (function) against wave length. Any perceptual color can be described by the stimilus level of the three cones.

For a light source, described by wavelength-intensity function $\phi(\lambda)$, the perception can be described by tristimulus. A 3-tuple of integration.


“2 lightsource have the same color” != they have the same spectrum. It means that, the tristumulus caused by the 2 lightsource are identical.

The L,M and S functions, are standarlized into “standard observer”, R,G and B, then transformed into X,Y and Z.. This is a little tricky but the important thing in mind, is the concept of tristumulus.


XY-Chromaticity Diagram


  • on the upper curve border is the visible colors(wavelength 380 - 700 mm)
  • The colors inside of the curve are produced by mixing the colors on the border. e.g. connect two points on the border to get a line of mixed colors
  • Any point inside of the area can be produced by multiple ways of mixing.
  • Colors on the curve border can not be produced by mixing therefore unique colors
  • Monitors: use (typically) 3 base color, forming a triangle of colors that they can reproduce. Outside of the triangle are the colors that the monitor cannot reproduce.

Characterize a display:

For a display device with three primaries, say red, green, and blue, we can mea- sure the spectral composition of the emitted light by sending the color vectors (1, 0, 0), (0, 1, 0), and (0, 0, 1). These vectors represent the three cases namely where one of the primaries is full on, and the other two are off. From the measured spectral output, we can then compute the corresponding chromaticity coordinates (xR , yR), (xG , yG ), and (xB , yB ).

The white point of a display is defined as the spectrum emitted when the color vector (1, 1, 1) is sent to the display. Its corresponding chromaticity coordinate is (xW , yW ). The three primaries and the white point characterize the display and are each required to construct a transformation matrix between the display’s color space and CIE XYZ.

RGB and sRGB

Each device has its own primitives (R,G and B) therefore the RGB specifiction is device dependent.

sRGB is a device independent description, is a smaller subset of XYZ space (and of most device’s RGB space). srgb

Gamma Correction

Monitors are nonlinear with respect to input: this nonlinearity is characterized by a $\gamma$ value.

$$I_{displayed} = I_{max} \cdot a^{\gamma}$$

in which a is the input pixel value in [0,1].

HOWEVER, WE WANT the desplayed Intensity to be a*MaxIntensity, there fore we need to find the monitors’ gamma and set

$a’ = a^{\frac{1}{\gamma}}$. so that if we feed a’ as input, the displayed color would become a*maxIntensity.


Fundamentals of Computer Graphics 4th Edition.

edited 13.01.2023
created 07.05.2022
[+] click to leave a comment [+]
the comment system on this blog works via email. The button
below will generate a mailto: link based on this page's url 
and invoke your email client - please edit the comment there!

[optional] even better, encrypt the email with my public key

- don't modify the subject field
- specify a nickname, otherwise your comment will be shown as   
- your email address will not be disclosed
- you agree that the comment is to be made public.
- to take down a comment, send the request via email.


the greater struggle via serocell - media feed March 30, 2024

Screenshot: New Device via Detritus March 18, 2024

Idiot's guide to resource migration in Terraform via Archive Fever by Edwin Wenink March 15, 2024
Sometimes we need to migrate resources that are managed in Terraform. Terraform is a declarative language to manage cloud infrastructure from code, which allows you to reliably automate your deployments and put your infrastructure configuration under versi…

Generated by openring from webring