Previous Contents Next

Chapter 7   Colour output

Interactive computer graphics are displayed on a colour monitor. The signals to drive the monitor are generated by the video circuitry of the graphics workstation. A broad understanding of these components helps explain the limitations which are met with when displaying colour, and how to minimize or work around these restrictions.

The majority of colour monitors in use today for computer graphics use a cathode ray tube (CRT), similar to that found in a television, to generate the picture. Other technologies, such as active matrix colour liquid crystal displays (LCD), do not at present give the high quality colours needed for computer graphics although they are widely used for less critical applications such as portable computers.

The principle of a CRT is that one or more electron guns produce variable amounts of electrons in response to an applied voltage. The electrons are accelerated towards the front of the tube by applying a large positive voltage to a grid.

The front of a colour tube is covered with three types of phosphor, which emit red, green and blue light when hit by electrons. Monochrome and greyscale monitors have only a single colour of phosphor. Electron beams from the guns are swept from top to bottom and left to right by the deflection plates to cover the screen area, and the voltages applied to the three guns are varied to adjust the intensity of the electron beam and hence the brightness of light emitted. A shadow mask is used to ensure that the electron beam from each gun can only fall on the appropriate type of phosphor.

7.1   Monitor gamut

Producing different colours by variable mixture of light from three coloured phosphors is very similar to the colour matching experiments described in section sect::colourmatch except that:

These differences mean that some visible colours cannot be reproduced on a CRT. The range of displayable colour is termed the gamut and varies for different makes and models of monitor. It may conveniently be depicted on a CIE 1976 UCS diagram, where it forms a triangle bounded by the monitor primaries. Each secondary lies on the line connecting the appropriate primaries, because the colours are additive. The white point should correspond to equal maximal output from the three guns. The example below (Figure 7.1) shows the gamut of the monitor on a VAXstation 3540 workstation.



Figure 7.1: The VAXstation 3540 gamut on the CIE 1976 UCS diagram.


The choice of monitor primaries is a trade off between obtaining a large gamut and making the display sufficiently bright. As the ISO luminous efficiency function (Figure 6.5) shows, the extremes of the visible wavelengths are seen as very dim. So the primary in the long wavelength corner tends to be a bright, orangish red rather than a dim deep red; similarly the primary in the short wavelength corner tends to be a fairly bright blue rather than a very dim violet.

The gamut of a monitor shrinks as the ambient light level increases, a fact which will be familiar to anyone who has tried to use a monitor in bright sunlight. Ambient light is reflected back from the monitor, adding white to all colours. This means that black becomes a dark grey. All colours move towards the white point, the darkest colours moving most. So, as the ambient light level is increased, typically deep blues are lost first, and only the lightest colours such as yellow and white can still be seen at high ambient light levels.

7.2   Factors affecting monitor quality

The colour fidelity and ergonomics of a colour monitor can be adversely affected by a number of factors:

Misconvergence:
the electron beam does not hit the correct pixel. This results in blurring of the edges of shapes and upsets the colour balance; if for example the green gun is also lighting up the red pixels to an extent, then all greens will be tinged with yellow (the secondary colour resulting from a mixture of green and red). The gamut will clearly be reduced, the position of the green corner of the gamut triangle moving towards the red corner in this example. Misconvergence tends to be most apparent at the edges of the display and in older monitors. Solution: Many monitors have internal controls to adjust convergence. Have these adjusted by a competent service engineer. Use a degauss button regularly, if there is one. Do not site monitors next to magnetic fields, such as loudspeakers or power cable conduits.
Flicker:
caused by the refresh rate of the screen being too low, or the use of an interlaced display (where the electron beam traces all the even lines, then all the odd lines). Solution: do not use a video mode of higher resolution than the monitor can cope with. Do not use interlaced modes.
Phosphor aging:
over a period of a year or so, the brightness of the phosphors will fall. Blue is affected faster than red or green. Solution: Do not rely manufacturers data for old monitors; have the values measured. For accurate work, use an auto-calibrating monitor.
Gun interaction:
the intensity of the electron beam depends on the power being produced by the other two guns at the time. Also, the intensity of a white pixel will be different if the rest of the screen is all white or all black, because of power drain. Solution: avoid cheap monitors with inadequate power sup- plies.

7.3   Video circuitry

The image displayed on a computer graphics monitor is composed of a two dimensional array of dots, termed pixels. These are the smallest addressable areas on the screen whose colour can be individually changed. The video image is defined by an area of memory in the computer, the video RAM (Random Access Memory), which in most workstations can be written to at the same time as the video circuitry is reading from it. Graphics workstations typically write to this memory with a mixture of both software and specialized hardware which performs common tasks (such as drawing polygons). Video RAM is read continuously by the video circuitry, which scans each pixel in turn and sends the values as a serial stream to be converted into monitor signals.

Considering the video RAM to be a two dimensional array, displays differ in both the size of this array and the colour resolution (number of bits per pixel). Together with the physical size of the monitor, this defines the spatial resolution (in pixels per inch) and the total number of simultaneously displayable colours.

Monochrome devices use one bit per pixel, so each pixel can be on or off, white or black. Greyscale devices use more bits per pixel, the total number of displayable greys being 2n , where n is the number of bits per pixel, typically 8. The binary number stored in video RAM for each pixel in turn is accessed by the video hardware and converted to an analogue voltage using a fast digital to analogue converter (DAC). This voltage is used to modulate the intensity of the electron beam in the monitor and so give different brightnesses.

Colour devices used in computer graphics typically use 24 bits to represent each pixel. These are organized as three groups of eight, giving 28 = 256 levels of intensity for each of the red, green and blue guns; 16.7 million colours in all. There are thus three DACs. This, plus the cost of the extra memory and the colour monitor, is why colour displays are more expensive than monochrome or greyscale displays.

Some displays, used for less demanding computer graphics applications, use only eight bits to represent each pixel. Very few devices organize this into three groups like the 24 bit displays; this would give far too few colours in most applications. Instead, each location in video RAM stores an 8 bit value which is used to index into a table of 256 colours. These colours are specified to a greater precision than 8 bits; 18 or 24 is common. The total range of colours is termed the palette; the table of selections from this palette is called the colour look-up table, or CLUT. Single chips containing a CLUT and three DACs are available, the combination being referred to as a RAMDAC.

Although the total number of colours in the palette can be as high as the total number of colours in a 24 bit display, only 256 of them can be used in any one image. This configuration is an example of indexed colour, whereas the 24 bit display described previously is an example of a direct colour system.

It is significantly faster to rewrite the data in the colour lookup table (256 entries, 3× 8 bits, so 768 bytes) than to change the colour of each pixel in video RAM (typically 1280× 1024 entries, 8 bits, so around 1.3 million bytes). Rewriting the CLUT can be used to provide fast animation of an image with few colours.

A refinement of the 24 bit display uses this indexing technique for each 8 bit group, to index into a table of (typically 12 bit) colour values. There are thus three of these tables, one for each gun, and three 12 bit DACs are used. Whereas the entries in the CLUT of an 8 bit indexed display are independent of one another, the entries in this system are typically ordered to form a colour scale. This allows the maximum value and response curve of each DAC to be changed, to compensate for drift or aging in the calibration of the monitor.

7.4   Gamma correction

One of the assumptions made when converting between XYZ and RGB is that colours are linearly additive. This assumption is invalid for a number of reasons, primarily because linear increases in the voltage applied to the guns does not produce a linear increase in luminance. The light produced by a phosphor is proportional to the electron beam power, rather than the gun voltage.

Power = voltage× current
Current µ grid  voltage1.5
so,Luminance µ voltage2.5
In practice, luminance is proportional to the DAC voltageg , where g is in the range 1.5 to 3.0 . Thus, the values in video RAM or in the CLUT should be adjusted to compensate for this. Some display hardware has this correction built in. Because the spacing of values has the same minimum (0) and maximum (255) values, but is non linear, one result of gamma correcting the values in video RAM is a decrease in the number of available colours. This is why some systems use 24 bits to represent each pixel, but then use three 12 bit lookup tables to perform gamma correction and drive the DACs, maintaining the full range of colours.

There are three ways of obtaining a value for gamma correction of a monitor:

  1. Direct measurement of standard greys using a light meter or spectroradiometer
  2. Asking the monitor or tube manufacturer
  3. Visual calibration
Some monitors have internal gamma correction in hardware, and need no further adjustment. To detect such a monitor, refer to the manual or carry out a quick visual calibration. The majority of monitors will, however, require gamma correction.

7.4.1   Direct measurement

For simplicity, we will assume that all three guns are to be calibrated together. The method simply consists of generating a series of test patches of known RGB value, measuring the actual light emitted, and plotting the test value against the measured value.

Using a large number of samples, and performing duplicate tests, helps reduce random errors and give a more precise result. Each patch should be measured at the same part of the screen, conventionally the center, to minimize the effect of misconvergence. If desired, a patch near one corner can be measured in a separate series, and the results averaged.

Provided the phosphors are not being driven into saturation, the measured gamma value should be much the same regardless of the setting of the brightness control. Although the eye can adapt to the ambient light level, a meter cannot, so the screen and meter should be well shrouded with heavy cloth such as a curtain, to eliminate stray light.

Remembering that the gamma function is a power law, the input RGB value and output light level should be plotted on a log/log scale. The spacing of the test samples should take this into account, so that samples are evenly spaced on the log axis.

If the data points cluster around a straight line, the slope of that line is the gamma value. Significant deviations from a straight line can only be dealt with by a lookup table.

7.4.2   Visual calibration

This simple method has the advantage of requiring no equipment. It relies on visual comparison of two grey patches. Visual comparison can be quite accurate and precise, and is after all the basis of the CIE standard observer.

The method relies on the fact that, regardless of the gamma value, white and black are fixed points. This is shown in Figure 7.2; altering the gamma value only affects the amount of curvature, not the position of the end points.



Figure 7.2: Three gamma curves.


If a checkerboard pattern of black and white squares is displayed, the result looks grey if the grid is fine enough. The light level will be 50% of the maximum, white light level, because of additivity (assuming that the black is effectively zero). This corresponds to the grey that would be obtained with R,G and B all 0.5, if the monitor had a gamma of one.

A grey colour is mixed, for example using a paint package, keeping R,G and B equal. If the HLS colour model is available, mixing a colour with a saturation of zero will accomplish this. Call the value of RGB which matches the checkerboard pattern V. The gamma value is given by:
gamma=
log (0.5)
log (V)

For example, if V is 0.73, the gamma is 2.2.

7.5   Usage of colour

Used wisely, colour can greatly add to the usefulness, clarity and impact of a graphic. Used badly, however, it serves only to confuse and obscure. Colour can be used:

If colour is being assigned some coded meaning, for example in status displays or user interface design, the number of colours should be strictly limited. Many studies have shown that no more than six or seven colours should be used in this fashion, and they should be clearly distinguishable. Furthermore, it is preferable to add redundant information such as size or shape to reinforce the distinction.

If a continuous colour scale is being used to display the value of some variable - such as temperature or stress - over a surface then using more colours gives a finer gradation and enables small details to be seen. In this case, 256 colours from an 8 bit display may well be insufficient.

7.5.1   Selecting a colour model

For device independence, use a CIE colour model such as LCH for which CIE tristimulus values are available. If the chosen output device does not directly support CIE colour specification, colours can often be converted to the native colour space of the device.

For accurate work, where an exact colour match is important, use a calibrated monitor and a viewing cabinet, with CIELUV.

For particular applications - textiles, architecture, graphic arts - use the appropriate specialized colour model which is conventionally used in that application area. For example, CIELAB, Coloroid, or Pantone respectively.

To mix device independent colour, use a colour model with a polar coordinate system to give a hue wheel. For example, LCH.

To mix distinguishable but device dependent colour, use a polar model such as HSV or HLS.

Use RGB if it is all that is available, but consider selecting from HSV and converting to RGB.

Do not use CMY directly. The number of variables which must be altered is too large.

7.5.2   Colour schemes

A range of related colours used together give a unified, uncluttered look. A poor selection of colours can look confusing or garish and may contribute to eye strain if viewed for long periods of time. To some extent, the selection of related colours is a subjective process; however help can be obtained from both artistic conventions and colour science. In many cases, the empirical guidelines from the artistic world can be explained in terms of colour science.

Complementary colours are those on opposite sides of a colour wheel. Using complementary colours produces a busy, attention-getting display. To avoid looking garish, the chroma should be reduced for large areas. It is often useful to use one colour or group of similar colours for large areas, so that their complementary colours will stand out when used in small amounts as highlights or accents.

Different colour models use different spacings of colours round a hue wheel, so the exact colour which is found to be the complement of another varies with the colour model. A true perceptually uniform scale would give the correct colour.

Determining complementary colours can be readily done by eye. Simply stare fixedly at a small patch of colour on a black background for a minute or so. Looking at a well illuminated white surface will produce an after image in the complementary colour. Note that the precise colour obtained from an after image depends on the illuminant used.

After images are caused by the photosensitive pigment in the cones becoming bleached as a continuous high chroma colour stimulus is applied. Staring fixedly, without moving the eye, keeps the image on the same cells in the retina. In the resting cell, used pigment is replenished. By not allowing this to take place, the pigment in each cone type is depleted in proportion to the degree to which that colour excites each cone type. For example, a green stimulus will bleach M cones the most. Looking at a white surface will give the illusion of a pink colour until the pigment is replenished.

A graphic which incorporates many intense unrelated colours will look cluttered and confusing; there is no single point of focus. Using groups of related colours and using high chroma colours sparingly for accentuation avoids this effect and gives a focused, controlled and professional look.

If particular colours are to have individual meanings, these should be clearly explained and the colours readily distinguishable. Some colours have conventional meanings which are widely - if not universally - understood. For example, red is associated with action, excitement, danger, heat and stop. Such meanings are overloaded and may be contradictory. They may also be specific to a particular culture.

When a smooth range of colours is to be used, it is useful to incorporate existing meanings, especially those used unambiguously by a clearly defined group. For example, in medical imaging the convention is that red denotes normal tissue and blue, diseased tissue. In cartography, a range of dark blues shading to light blues and white represents progressively shallower seas; yellows, greens and browns represent increasing land height, culminating in purple and white for mountain tops.

Don't have blue and red together. Don't use blue as a foreground colour, where shape must be distinguished; however it makes a good background. Why: chromatic aberration in the eye makes it impossible to fully focus on red and blue simultaneously. The eye will tire from continual re-focusing, and settle on a lens position where neither colour is fully in focus. When using blue as a background, it has no fine shape so gentle blurring is unobtrusive. The phenomenon of stereopsis gives the appearance of depth.

Don't have fine detail in blue or red on dark coloured backgrounds. Why: the photopic luminous efficiency curve is sharply peaked in the yellow and green part of the spectrum. Colours at the spectral extremes will appear much darker than yellows and greens at the same measured light power level. Similarly, yellows and greens on a light background will have low contrast and thus be difficult to see.

Don't use blue or violet for small moving shapes such as mouse cursors. Why: S cones have a slower response than M or L cones. Therefore they cannot detect rapid changes in position of blue and violet objects. The density of S cones in the fovea is much less than the density of M and L cones. Therefore, the spatial resolution for blue objects is much less than for other colours ( a fact which, as we have seen, is made use of by sub-sampling in video encoding)

Don't rely on red/green discrimination to convey important information. Why: a significant proportion of your audience will have reduced or missing sensitivity to red/green differences.

Do use perceptually uniform colour spaces to construct colour scales. Why: Colour scales with perceptual jumps can give a false impression of spurious detail. Areas of little colour change can mask details. A perceptually linear colour scale facilitates estimates of the displayed parameter.

7.5.3   Interpolation

The colour space chosen affects how colours are interpolated. This has bearing on the production of colour scales for visualization. Perceptually uniform spaces are to be preferred to avoid discontinuities or distortions of scales. Polar coordinate spaces are often easier to work with than Cartesian spaces.

In addition to straight linear interpolation, it may be useful to construct a colour scale along a curve through some colour space. Although the curve through HSV space is smooth, there are sudden perceptual jumps; for example between yellow and orange.

Non linear colour interpolation may be used as a form of depth cueing. For example, in the representation of outdoor scenes, distant objects can be made more blue and less saturated. This mimics the effect of atmospheric haze.

Pseudo colour can be used to enhance detail or visualize small changes. Examples of this type of application are medical imaging, geographical information systems, and finite element post-processing.


Previous Contents Next