What is a colour space?

In my job I probably use the phrase “colour space” every day and have done for the last 20 years. So imagine my surprise when I was talking with a colleague recently and after a few minutes he said “Can I stop you for a second there Steve – when you say colour space, what exactly do you mean?”.

A colour space is like a map. A map of New York, for example, shows the location of various landmarks with reference to the xy coordinates (the position in horizontal x and vertical y units on the map). A colour space or colour map does the same thing with colours. Perhaps the simplest colour space is the spectrum, see below:
 myspectrum

As we look from right to left on the spectrum the wavelengths changes from around 700nm on the far left to about 400nm on the far right. So this map shows colour with reference to wavelength. Although it is a commonly used colour space it is limited because it only really describes how hue changes with wavelength. Hue is only one of three ways in which colour can change or vary.

The most well-known really useful colour space then is the CIE chromaticity diagram – see below.

chromdiagram

The CIE chromaticity diagram shows colours arranged on a 2-D plane. We can easily refer to any colour by how far from the left it is (the x coordinate) and how far from the bottom it is (the y coordinate). This space only shows two of the dimensions of colour; the hues are arranged in a somewhat circular way and the colourfulness increases as we move outwards from the white point (a position near to the centre of the diagram). However, we can also consider the third component of colour (brightness) if we imagine a dimension coming out of the page towards you (http://colourware.wordpress.com/2009/07/18/cie-system-of-colorimetry/). The CIE defines several different colour spaces; the CIELAB colour space, for example, is another 3-D space that defines a colour by its L*, a* and b* values.

It is useful to think of an image-display device as also having a colour space. Consider the display on which you are probably reading this blog. The display shows colour by changing the amount of the red, green and blue light emitted at each point on the screen. The diagram below is a representation of what the RGB colour space of your display device may look like.

 

rgb

In the RGB cube, black is in the bottom left. As the RGB values increase colours are created and white results from each of the RGB primaries at full strength. So the RGB colour space defines the relationship between RGB values and colour. However, here’s the really interesting thing: The colour space for different display devices is very different. Even if we take a single device – such as the one that you are reading this blog on – then as we change settings (the brightness, the contrast, the gamma, the colour temperature, etc.) then the colour space changes. That is, the relationship between RGB and colour changes as you change those settings. This is a huge problem. Imagine if there were many maps of New York and each showed the position of, say, the Empire State Building to be in a different position. How confusing would that be? Well, that’s the problem with colour-display technology. If we didn’t do anything about this problem then every time we looked at a colour image on a different display device the colours could change markedly. This is why we need colour management. Colour management can make compensations to the RGB values that are sent to each display device so that the colours always appear the same (well, nearly the same). To make this compensation the colour management software (which is embedded in your Windows or Apple operating system) needs to know about the colour space of each device connected to the computer. Each device needs to have a profile that describes the relationship of its own colour space with respect to some standard colour space. 

How good is colour management? Well, that depends upon many factors. Most printers, cameras, scanners, and screens (LCD, CRT, etc.) come with a driver that includes a crude colour profile. This ensures that there is a basic level of colour management and for a great majority of users this is more than adequate. However, if you want better performance then you need to think about making some measurements that will allow a more accurate colour profile to be built. In a recent blog I described a new device that you can buy to enable you to do this – http://colourware.wordpress.com/2009/07/29/colormunki-colour-management/. There are many such devices on the market. I highly recommend Andrew Rodney’s book Color Management for Photographers which is both clear and accurate (though the edition I have works on Adobe’s CS2 package whereas the latest package is CS4).

514PWPFTKXL__BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU02_

However, no matter how hard you try, colour management is never likely to be perfect. This is because different devices have different colour gamuts; a printer is likely to be able to display some colours that your display physically cannot and vice versa.

CIE system of colorimetry

For about 100 years there has been an international system for colour specification – it’s called the CIE system. The acronym comes from Commission Internationale de L’Eclairage.

This system is based on the notion of additive colour mixing – http://colourware.wordpress.com/2009/07/13/additive-colour-mixing/

Since it is possible to mix together three primary lights and make a wide gamut of colours (though not, of course, all colours) the principle is that the amounts of these primaries that an observer would use to mix togther to match a colour is a useful specification of that colour. We refer to these amounts as tristimulus values. One could imagine a visual colorimeter whereby an observer would try to match a colour that is to be specified by adjusting the intensities of three primary lights that are mixed together – once a match is obtained then the tristimulus values would define or specify the colour. All that would be necessary would be to able to decide on a set of primaries and manufacture the visual colorimeters so that they are very consistent from one device to the next. It would be a little clumsy though to have to use one of these visual colorimeters. But in principle it could work.

Fortunately the CIE does not require the use of such visual colorimeters since in 1931 the CIE measured the trismumulus values that observers made when matching various colours. These were averaged to create the so-called CIE standard observer.  And here’s the really clever bit. Having defined the CIE standard observer it is possible to calculate the tristimulus values (the amounts of the three primaries that an observer would use to match a colour) without any further observations. All that is required is that we know the amount of light at each wavelength reflected by a sample or (in some cases) emitted from a device such as computer display and then – by using our knowledge of the CIE standard observer – it is possible to calculate the tristimulus values.

So what were the primaries. If you have read my previous post, What is a colour primary – http://colourware.wordpress.com/2009/07/08/what-is-a-colour-primary/ - you’ll know that the choice of colour primaries is somewhat arbitrary. Well, in fact the original determination of the standard observer what carried out in England using red, green and blue primaries. But the data obtained were later modified to refer to a different set of primaries known as X, Y and Z. It was necessary to make this adjustment because using any set of real primaries it was impossible to match any colour with mixtures of the primaries; using RGB meant many colours could be matched, but not all. So a set of so-called imaginary primaries was conceived which could – in theory – be used to match all colours. So the tristimulus values of the CIE system are known as X, Y and Z. 

In fact, it didn’t really matter which set of primaries was used; the CIE system was concerned with colour matching. If two samples have the same tristimulus values then they would be a visual colour match no matter which set of primaries was used. So the choice of primaries really was not critical.

Today many instruments are commercially available – colorimeters, reflectance spectrophotometers, radiometers) – that, with the use of software, allow the CIE XYZ values to be measured; these instruments are extremely valuable in many industrial and commercial applications. The CIE system is still very much alive today, though many users often prefer to use one of the more advanced colour spaces – such as the CIELAB colour space – which was defined by the CIE in 1976 and whose values are very easily calculated from the CIE XYZ values.  For further information about the CIE please visit their web site - http://www.colour.org/