Last Updated April 4, 2008
Colour plays a vital part in computer graphics and realistic scenes cannot be generated without a suitable range of colours available. But there are many competing ways to specify colour, each method has its good and bad points.
Visible light, ultraviolet light, x-rays, TV and radio waves, etc are all forms of electromagnetic energy which travels in waves. The wavelength of these waves is measured in a tiny unit called the Angstrom, equal to 1 ten billionth of a meter. Another unit sometimes used to measure wavelength of light waves is nanometers (nm) which are equal to 1 billionth of a meter.
There is a narrow range of this electromagnetic energy from the sun and other light sources which creates energy of wavelengths visible to humans. Each of these wavelengths, from approximately 4000 Angstroms to 7000 Angstroms, is associated with a particular color response. For example, the wavelengths near 4000 Angstroms (400 nm) are violet in color while those near 7000 (700 nm) are red.
The colours we see 'see' at certain wavelengths do not exist in reality, they are created by our brain. Issac Newton said
... the Rays to speak properly are not coloured. In them there is nothing else than a certain Power and Disposition to stir up a Sensation of this or that Colour.
It was discovered long ago by artists, that (almost) any colour can be described interms of a combination of 3 primary colours. This resuts from the way we detect light. The Human retina has cells called "cones" which detect either red, green or blue wavelengths of light.
This model is the traditional form of colour specification in computer graphics. Colours are defined as a triple of values, each value representing the intensity of the red, green or blue component of the colour. In this system;
The number of discreet colours that can be generated by this system is determined by the number of bits assigned to represent each colour. In a 24-bit system (photorealistic) there are 8 bits for each colour component, giving 256\times256\times256=16 \textrm{million} different colours. This system was first developed as a consequence of the way the human eye works. The eye contains receptors for red, green and blue light respectively, the brain combines these three 'readings' to give the perception of one colour. This however is a simplified view of how the eye actually works. This model also corresponds closely with the way most graphic displays work. Each pixel on a monitor has a red, green and blue component. The colour of a pixel can be controlled by varying the relative brightness of each component.
The 3 components of the RGB system describe a region in colour space called the RGB Cube. Each of the three primary colors form mutually perpendicular axes.
However the system is not perfect.
Again a triplet of values is used.
The HSV system is usually shown as a hexagonal cone (hexcone).
HSV values can easily be converted into RGB values for display. The two systems describe the same set of colours. One problem with this system is that it implies that all maximum intensity colours have the same brightness (value), however looking at blue and yellow show this is obviously not the case in reality. Also this system is perceptually non-linear (similar to RGB), and does not represent all perceivable colours.
Similar to the HSV model except the value axis has been replaced with a lightness axis which has been stretched to form a double Hexcone.
Now white and black have the same geometric status. However the saturated hues now occur at L=0.5 which can be a problem for intuitive colour selection.
The CIE (Commission Internationale de l'Eclairage) conducted experiments in the 1930's to determine how primary components should be added in order to reproduce colours. The experiments revealed that to produce some colours, it was necessary to subtract a component of light. This is because when two primaries are added the saturation decreases. It was impossible to produce a maximally saturated colour by mixing two others. To create such colours a negative component is required. To avoid the problem of having negative components, the CIE devised three supersaturated (non-realizable) colours X, Y, Z, which, when additively mixed (i.e. without negative co-efficients) can produce all perceivable colours. These primaries are devised from the colour sensitivity distribution of the human eye, this allows the system to represent all human perceivable colours. In this system the colour the intensity or luminosity of the light. Applying some affine transformations and choosing an appropriate viewpoint, the CIE colour space can be viewed in 2 dimensions (figure below).
This colour model is difficult to use, as X,Y and Z do not correspond to real colours. Also, some CIE colours cannot be displayed on a traditional monitor as these work by adding red, green and blue light. It was not designed as colour selection tool, but as an international standard for accurate colour description, instruments are available which can measure the X,Y & Z components from any give colour sample.
A somewhat simplified and perceptually linear version of CIEXYZ used today is CIELab.
L= luminosity
a = position on Red-Green opponent channel ( -ive= red, +ive=green)
b = position on Yellow-Blue opponent channel ( -ive= yellow, +ive=blue)
The colour gamut of a printer is also shown, this gamut is not a simple triangle because of the mechanisim in which the inks are placed on the paper. Note that a printer cannot reproduce all the colours of a monitor and there are some printer colours which cannot be shown on a monitor.
© Ken Power 2009