Good Colour Maps: How to Design Them


Peter Kovesi
Geophysics & Image Analysis Group
Centre for Exploration Targeting
School of Earth and Environment
The University of Western Australia
peter.kovesi@uwa.edu.au

June 2014
Early Draft: A more developed version of this work has been submitted for publication.


Home Download Test Image Theory Software

Abstract

Many colour maps provided by vendors have highly uneven perceptual contrast over their range. It is not uncommon for colour maps to have perceptual flat spots that can hide a feature as large as one tenth of the total data range. Colour maps may also have perceptual discontinuities that induce the appearance of false features. Previous work in the design of perceptually uniform colour maps has mostly failed to recognise that CIELAB space is only designed to be perceptually uniform at very low spatial frequencies. The most important factor in designing a colour map is to ensure that the magnitude of the incremental change in perceptual lightness of the colours is uniform. The specific requirements for linear, diverging, rainbow and cyclic colour maps are developed in detail. To support this work two test images for evaluating colour maps are presented. The use of colour maps in combination with relief shading is considered and the conditions under which colour can enhance or disrupt relief shading are identified. Finally, a set of new basis colours for the construction of ternary images are presented. Unlike the RGB primaries these basis colours produce images whereby the salience of structures are consistent irrespective of the assignment of basis colours to data channels.

Introduction

A colour map can be thought of as a line or curve drawn through a three dimensional colour space. Individual data values are mapped to positions along this line which, in turn, allows them to be mapped to a colour. For a colour map to be effective it is important that the perceptual contrast that occurs as one moves along the line in the colour space is close to uniform.

Many colour maps are designed as piecewise linear paths through RGB space. However, RGB is not the best colour space in which to design or analyse a colour map because it is not perceptually uniform. It is better to use a perceptual colour space such as CIELAB. This colour space is designed to be perceptually uniform whereby distances between points in the 3D colour space are intended to closely correspond to human perception of colour difference.

CIELAB space. The vertical axis corresponds to perceptual lightness, varying from 0 to 100. The a and b axes represent red-green and yellow-blue opponent channels respectively. The vertical axis at a = 0, b = 0 corresponds to the grey scale. The distance away from this axis corresponds to chroma/saturation.

Slices through CIELAB colour space at lightness levels of 10, 30, 50, 70 and 90. The achromatic point at each lightness level is indicated by the red cross. Only the sections of CIELAB space that can be represented within the RGB gamut are shown.

Shown below is a typical rainbow style colour map along with its path through the RGB and CIELAB colour spaces. Its straight line construction in RGB space is evident.

A colour map and its path through the RGB and CIELAB colour spaces.

In the figure above the spacing of the dots along the paths in the respective colour spaces is proportional to the spacing of adjacent values in the colour map. Notice the uneven spacing within the CIELAB colour space. The clustering of points in the green and red regions produce perceptual flat spots in the colour map. The kinks and uneven point spacing along the curve at cyan and yellow produce the false anomalies seen at these points. Notice also how the lightness values of the colour map increase to yellow, then decrease to red before increasing again to light pink. This reversal of lightness gradient contributes to the generation of the strong false anomaly at yellow.

Accordingly colour maps need to be designed with care. They should form a smooth curve in a perceptual colour space such as CIELAB and the perceptual contrast between adjacent entries of the colour map should be constant across the whole colour map.

The importance of lightness gradient

In order to achieve uniform perceptual contrast along a colour map an initial approach might be to set the spacing of colour map points along a path through colour space according to a colour difference formula such as CIE76 or CIEDE2000. This approach was used by Moreland (2009) whereby he used the CIE76 colour difference formula for the design of his diverging colour maps. However these colour difference formulas are derived from experiments where subjects are asked to compare patches of colour that subtend a significant field of view. Initially these difference formulas were developed from the CIE 1931 2° Standard Observer and then subsequently the CIE 1964 10° Standard Observer (Fairchild 2013). Noting that a 10mm screen object viewed at a distance of 600mm subtends about 1 degree of visual angle we can see that these colour difference formulas are only valid for spatial scales that are much larger than what we are typically seeking to resolve in an image.

As discussed on the test image page at fine spatial scales contrast sensitivity to chromatic gratings is significantly lower than it is for achromatic luminance gratings (Poirson and Wandell 1993; Mullen 1985; Lennie and D'Zmura 1988). Two colours that differ greatly in hue and/or chroma provide poor perceptual contrast if they have the same level of lightness. In addition to spatial frequency considerations there are also field of view effects. For small fields of view, below 0.5 degrees of viewing angle, there is also a severe loss of colour discrimination (Thomson and Wright 1947). Thus, for the purposes of colour map design, where we are interested in the ability to resolve fine structures, the perceptual contrast between colours is dominated by the difference in the lightness of the colours. Any difference in hue or chroma/saturation is relatively unimportant.

The importance of the lightness gradient is noted by Matteo Niccoli (2012) in his excellent series of blog postings The Rainbow is Dead... Long Live The Rainbow! In designing his perceptual colour maps he ensures the lightness profiles are linear, or follow a cube law to match Steven's power law. However his reasoning for using a cube law is not clear given that CIELAB lightness is intended to be perceptually linear.

To demonstrate the importance of lightness gradient the example below shows a colour map path through CIELAB space consisting of two line segments of equal length but of different slope with respect to lightness. The colour map is generated by selecting points equispaced along the path. This corresponds to points having equal colour contrast under the CIE76 equation.

The resulting colour map can be divided into two sections corresponding to the two segments of different slope. The left half of the colour map provides good feature contrast. The right half renders the test image very poorly with the feature contrast very much reduced as a result of the reduced lightness gradient across this part of the colour map. However, if we now resample the path through the colour space so that points have an equal increment in lightness value we get the following colour map.

The sine wave feature pattern can now be seen uniformly across the full width of the test image. Note the yellow section of the colour map is compressed because there is a small change in lightness from the centre point to the yellow end point. Thus, the number of colour map points on this section of the path are correspondingly reduced.

The importance of the lightness gradient in a colour map is made very evident when one constructs a colour map of constant lightness. The example shown below is generated from equispaced points on a curve through CIELAB space at a lightness level of 70.

Notice how the sine wave pattern in the test image is almost impossible to discern. At first sight such a colour map would seem to be a poor choice for displaying data. However, as will be shown later, constant lightness and low contrast colour maps are useful when displaying data with relief shading.

CIE76 or CIEDE2000?

The CIE76 colour difference formula uses the Euclidean distance in CIELAB space as the measure of colour difference. Various shortcomings of this measure ultimately led to the development of the CIEDE2000 formula which incorporates correction factors that are applied to the differences in lightness, chroma and hue. In seeking to equalize the perceptual contrast across a colour map the question arises as to whether one should use the CIE76 or CIEDE2000 formula.

As mentioned earlier neither colour difference formula was designed for the spatial frequencies we are interested in. A basic evaluation of the two formulas is provided in Appendix 1. In summary, the lightness correction that is incorporated in CIEDE2000 is possibly useful but its effect is barely noticeable. However, the CIEDE2000 chroma correction clearly does not perform well at higher spatial frequencies. If one is designing isoluminant, or low contrast, colour maps then the use of CIE76 will produce a map of more uniform perceptual contrast. On balance, and in the absence of any alternative, it would appear that CIE76 is the most appropriate colour difference formula to use. Though, for most cases, we are only interested in its lightness component.

The Colour Map Design Process

The colour maps presented here are constructed by specifying control points in CIELAB space and then fitting a 2nd or 3rd order B-spline through them to form a colour map path. A 2nd order spline forming a linear path between the control points and a 3rd order one using quadratic basis functions to form the path. B-splines provide a general and flexible means of defining colour map paths. This is important because colour map paths often have to be carefully hand crafted in order to achieve a desired perceptual outcome within the sometimes awkward constraints of the colour space gamut. Having formed a colour map path one then needs to determine locations along the path that are equispaced in terms of perceptual contrast to form the final colour map.

The technique used here for obtaining N colour map values of equal perceptual contrast along a colour map path is similar that originally used by Pizer (1981). First, an initial map is generated by evaluating N points at equal spline parameter increments along the path. The perceptual difference between successive colour map entries are then computed. For most colour maps one would just use the lightness differences between successive colour map entries for this. However for isoluminant, or low lightness contrast colour maps, one may wish to use the full CIE76 formula of the euclidean distance in CIELAB space to determine the perceptual contrast between entries. From this a cumulative sum of the contrast differences along the colour map is formed. The total cumulative contrast change is then divided into N equispaced values and a reverse mapping back to the spline parameters required to obtain these equispaced contrast values is obtained via linear interpolation of the cumulative contrast curve. A new colour map having equal perceptual contrast is then formed from these new remapped locations along the colour map path. In practice it useful to repeat this process recursively once or twice on the new colour map. This helps overcome any approximations induced by using linear interpolation on the cumulative contrast curve to estimate the locations of equal perceptual contrast. This is mainly an issue for colour maps with only a few entries. The overall process is illustrated in the diagrams below.


Colour map path through CIELAB space.

Initial colour map note the uneven perceptual contrast with flat spots at black, red and yellow.

Plot of the lightness differences along the colour map. Note how this is low in the black, red and yellow regions.


Plot of the cumulative sum of lightness differences along the colour map. Also shown is the mapping required to obtain equi-contrast locations on the colour map path.

Final colour map after remapping to obtain uniform perceptual contrast.

For most colour maps where perceptual contrast is dominated by lightness variations it is important to ensure that if the colour map path has segments of non-zero lightness gradient then it should not also have extended segments with little or no lightness gradient. If this is the case then when the path is sampled for points of equidistant lightness change one may end up with undesirable hue and/or chroma discontinuities in the colour map. Any attempt to remove the hue or chroma discontinuities by incorporating the CIE76 colour difference formula in the perceptual contrast equalization process is complicated by the fact that one should be mindful of the different characteristics of the eye's sensitivity to contrast in luminance and chromaticity. Luminance contrast sensitivity is band-pass in nature whereas chromatic contrast sensitivity is low-pass in nature. Thus, the perceptual contrast across a colour map is inescapably a function of spatial scale. However, to minimise the effect of scale a colour map path should be dominated either by lightness changes or by chromatic changes, but not a mixture of both. We want to avoid any perceptual contrast equalization process requiring luminance contrast to be played off against chromatic contrast over different sections of the colour map path. Under this situation, with the different characteristics of the eye's sensitivity to colour and luminance, one is likely to produce a map that is especially scale dependent with regard to perceptual contrast.

Dealing with lightness gradient reversals

Where a reversal in the lightness gradient is required, say for a diverging colour map, the resulting discontinuity in the lightness gradient induces the perception of a false feature as illustrated below.

To remove the perception of this false feature the lightness values can be smoothed, say with a Gaussian filter. This smoothes the gradient reversal and removes the false feature. However, a compromise has to be accepted. The smoothing introduces a small region in the colour map where the lightness gradient is reduced to zero. This creates a small perceptual flat spot where structures will be harder to see.

The degree of smoothing required to remove the perception of the false feature is not large. A Gaussian filter with a standard deviation of around 7, within a 256 level colour map, is typically sufficient.

It should be noted that a lightness gradient reversal will induce a perceptual flat spot even if no smoothing is applied. Structures in the data with values that straddle the central reference point in the map will be represented by colours that are effectively isoluminant, for example, blues and reds of nearly equivalent lightness. Thus, structures in this data range will be hard to resolve. Accordingly, reversals of the lightness gradient in a colour map should be avoided where possible. Anyone interpreting data rendered with such a colour map should be aware of this perceptual limitation.

Slope discontinuities in attributes other than the colour lightness are relatively unimportant. An example is shown below where we have a constant lightness colour map path with a sharp slope discontinuity at red.

While a slight feature is just discernible it is certainly not as noticeable as an equivalent slope discontinuity in lightness. Nevertheless it would seem useful to ensure all colour map paths have continuity in slope either through the use of splines or by smoothing piecewise linear paths.

In summary: In most cases to obtain uniform perceptual contrast a colour map should have a constant rate of change in lightness values over its full range. Only for isoluminant or very low lightness contrast colour maps is it important to also consider hue and chroma differences. Where a reversal in the lightness gradient is required this should be smoothed to avoid the creation of a false perceptual feature within the colour map. However, it must be recognized that this will induce a localized perceptual flat spot in the colour map.

A Taxonomy of Colour Maps

Colour maps can be organized according to the following attributes: Linear, Diverging, Rainbow, Cyclic, and Isoluminant.


Linear colour maps are intended for general use and have colour lightness values that increase or decrease linearly over the colour map's range.


Diverging colour maps are suitable where the data being displayed has a well defined reference value and we are interested in differentiating values that lie above, or below, the reference value. The centre point of the colour map will be white, black or grey.


Rainbow colour maps have well documented shortcomings (Borland and Taylor 2007). However rainbow colour maps are ubiquitous and are unlikely to go away. Accordingly they warrant a category of their own.


Cyclic colour maps have colours that are matched at each end, ideally with first order continuity. They are intended for the presentation of orientation values or angular phase data.


Isoluminant colour maps are constructed from colours of equal perceptual lightness. These colour maps are designed for use with relief shading. On their own these colour maps are not very useful because features in the data are very hard to discern. However, when used in conjunction with relief shading their constant lightness means that the colour map does not induce an independent shading pattern that will interfere with, or even hide, the structures induced by the relief shading. The relief shading provides the structural information and the colours provide the data classification information.

Colour maps may have multiple attributes. For example, diverging-linear, diverging-isoluminant, or cyclic-isoluminant. In addition to isoluminant maps one can construct low lightness contrast colour maps for use with relief shading. The aim being to combine the perceptual cues that might be obtained from, say, a linear or diverging colour map with the perceptual cues that can be obtained from relief shading.

Linear colour maps

The distinguishing feature of these colour maps is that the lightness values vary in a linear manner even though the colour map path itself may be curved. This linear variation of lightness induces a clear ordering of colours in the map, making interpretation of data straightforward. Thus, linear colour maps are suitable for general purpose data display.


Some colour map paths through CIELAB space and their corresponding linear colour maps.

When designing linear colour maps it can be useful to avoid going to the extreme limits of the lightness range. It is usually better to constrain the range to, say, 10 to 95 rather than using the full range of 0 to 100. It is often the case that monitors and printers display a reduced lightness range more reliably with features at the dark and light ends of the colour map being less susceptible to saturation. The overall image contrast will be reduced slightly but the ability to identify features in the data may be better.

Diverging colour maps

Diverging colour maps are intended for the display of data having a well defined reference value where we are interested in differentiating values that lie above, or below, this reference point.

Within the colour map the reference value is typically denoted by a neutral colour. The most commonly encountered diverging colour map is a blue-white-red map. As mentioned earlier such a colour map involves a reversal of lightness gradient at the centre that requires smoothing to avoid the creation of a false anomaly. While this may be the most commonly seen diverging colour map other variations are possible. The central reference value can be denoted by black rather than white. A linear-diverging map that varies from, say, blue through grey to yellow can also be useful. By having no lightness gradient reversal it avoids the creation of a perceptual flat spot at the centre and is perhaps more intuitive to interpret. One can also conceive of an isoluminant, or low contrast, diverging colour map for use in conjunction with relief shading.

For perceptual symmetry the first and last colours in a diverging colour map should have the same chroma, and if the lightness values reverse then the first and last colours should also have the same lightness. Without sufficient care a diverging blue-white-red colour map constructed in RGB space may not have this perceptual symmetry. RGB red and blue have lightness levels of 53 and 32, and chroma values of 105 and 134 respectively.


Some colour map paths through CIELAB space and their corresponding diverging colour maps.

The example below provides a comparison between different kinds of diverging colour maps. The data is a residual gravity image of West Africa. Of interest is the deviation of data values above and below zero. A greyscale image of the data allows structures within the data to be seen but it is hard to get a sense of the deviation above and below zero except for the strongest features. The diverging blue-white-red and blue-black-red colour maps allow the polarity of structures to be readily determined but features near zero are hard to resolve due to the perceptual flat spots at the centre of these maps. On the other hand, the blue-grey-yellow linear-diverging colour map, having no reversal of lightness gradient, has no perceptual flat spot at the centre and provides an intuitive ordering of colours. This kind of diverging colour map should probably be used more widely.

 

 

 

 

Left to right, top to bottom: Residual gravity image of West Africa in linear greyscale; blue-grey-yellow linear-diverging colour map; blue-white-red diverging colour map; and blue-black-red diverging colour map. Note that a standard diverging colour map has a perceptual dead spot in the middle that makes resolving features at the mid point difficult. This is why structures in the white regions of the bottom left-image and the black regions of the bottom-right image are hard to resolve. This problem is avoided using a linear-diverging map (top-right) because the lightness values of the colours in the map increase in a linear fashion.

The colour sequences that can be used for linear-diverging colour maps is somewhat constrained by the gamut boundaries of CIELAB space. A blue-grey-yellow sequence might not be one's first choice aesthetically but it allows the maximum range of lightness values across the colour map while also permitting end point colours with chroma that is both large and equal.

It is worth commenting here that for data to be rendered correctly with a diverging colour map it is important that the data values are respected so that the desired reference value within the data is correctly associated with the central entry of the diverging colour map. In many visualization packages the default display methods may not respect data values directly. Typically data values are normalised by applying an offset and rescaling, before rendering with a colour map for display. Obviously this can lead to incorrect display of data with a diverging colour map.


Rainbow colour maps

The construction of rainbow style colour maps requires a contrived path through CIELAB space. They also involve reversals in the lightness gradient at yellow and red which can upset a viewer's perceptual ordering of the colours in the map. Thus rainbow colour maps should be avoided. However, perhaps because they are attractive, it would appear unlikely that people will stop using them. It might also be argued that they can have a legitimate use where the main aim is to differentiate data values rather than communicate a data ordering.

With care it is possible to generate a minimally bad rainbow colour map. First, it is best to construct the colour map path so that in going from blue to green it does not pass through cyan. If cyan is included the path from cyan through green to yellow has very little lightness variation. This creates an extended region of low perceptual contrast that is not readily corrected. False anomalies are also induced at cyan and yellow, see the figure below. With cyan excluded, and using a less extreme colour map path that incorporates a darker green, it is possible to equalize the magnitude of the lightness gradient and thus obtain uniform perceptual contrast. If this is then followed by smoothing of the lightness reversals at yellow and red to reduce the perception of false anomalies at these points one can obtain a reasonable colour map, albeit with small perceptual flat spots at yellow and red.



A vendor rainbow colour map (top) and a perceptually uniform rainbow map (below) with their paths through CIELAB space. Note the more extreme path of the vendor map and the resulting false anomalies and perceptual flat spots.

The main problem with rainbow colour maps is that having yellow (and perhaps also cyan) in the interior of the map creates a colour ordering conflict. The rainbow colour map presented here can be thought of as being the combination of three linear colour maps: A blue to yellow map; a red to yellow map; and a red to pink map. Individually each of these colour maps provide a logical ordering of colours with lightness values increasing from left to right. However, in constructing the overall colour map the red to yellow segment is reversed when it is inserted into the composite map. This makes the colour ordering of the overall map inconsistent. So while red may be 'greater than' green in terms of position in the colour map individually the perceptual ordering of the two colours is not clear. If a rainbow colour map also includes cyan then an additional colour ordering ambiguity is introduced because cyan is slightly lighter than green.


Construction of a rainbow colour map from the combination of three linear colour maps. The reversal of the red-yellow component creates a colour ordering inconsistency.


Cyclic colour maps

To present orientation values or phase data effectively in a visual way requires the use of a cyclic colour map. A map that is often employed for this purpose is the hue circle from the HSV colour space. However, this colour map has a number of problems. The perceptual contrast is uneven across the colour map with sections of low lightness contrast from cyan to yellow, and from red to magenta. The secondary colours of cyan, magenta and yellow, being lighter, also tend to generate false anomalies. See the figure below.

The other problem with this colour map is that, being based on the three primary colours, it partitions the circle into three segments; a red, a green, and a blue segment. These are separated by smaller sections corresponding to the secondary colours. This is not consistent with the way in which we typically divide the circle. Generally we tend to think of the four main compass directions of north, south, east and west. Alternatively we may be just interested in a partitioning of phase into positive and negative regions corresponding to the peaks and troughs of a periodic sine wave. Either way, the partitioning of the circle into three, or six, segments as is done by the HSV colour map means that it is a difficult map to use when one is trying to communicate angular information in a visual way.


A cyclic colour map formed from the fully saturated hue circle in HSV colour space and its path through CIELAB space. This colour map has uneven perceptual contrast and provides no intuitive mapping between features on a typical cyclic signal and the colours on the map.

Ideally, in a manner similar to diverging colour maps, where we wish to have a recognizable reference point, we would like cyclic colour maps to have recognizable sections that can be related to the four main compass directions. This, in conjunction with the desire to have even perceptual contrast, means that designing good cyclic colour maps is a challenging task.

A colour map formed from a circle at a constant level of lightness in CIELAB space is an obvious map to construct. However, a difficulty is that the size of any circular path centred on the a = 0, b = 0 axis is heavily constrained by the gamut boundary. A lightness level of around 65 to 75 allows the largest diameter circles to be constructed. Even so, the maximum chroma is only about 40 and the colours obtained are not very vivid making it hard to identify any reference regions in the colour map. Also, the fact that the colour map is of constant lightness means that the resolution of fine scale features is difficult.

To obtain a colour map with good fine scale feature resolution and with four identifiable regions that can be associated with the main compass directions requires a colour map path that visits four distinct colours of high chroma that are also distributed with some symmetry of lightness values. One strategy to achieve this is as follows: Two light colours of equal lightness, and two dark colours of equal lightness are chosen. A colour map path that alternates between light and dark colours in a cyclic zig zag pattern is then used to form the map. If the perceptual contrast equalization of the colour map only takes into account the lightness differences of the colours then the four reference colours will end up being equally spaced in the colour map even though the path lengths between the colours are quite different. Finding four colours with reasonably large chroma that form a harmonious sequence is challenging given gamut constraints. Another factor to consider is that an important part of having colours that can be recognized is that they should be colours that we can readily name (Green-Armytage 2010). A path that has proved successful is one that traverses blue, a darkened yellow, dark red, pink and back to blue. Alternatively, the darkened yellow can be replaced with green. This produces a map with better defined quadrants though the colour sequence is not so harmonious. In designing such a map one often needs to incorporate additional intermediate control points in the path to try to equalize the width of the four colour segments. This process is subjective and not always achievable with complete satisfaction. Finally, the four lightness gradient reversals in the colour map need to be smoothed, and this will induce small perceptual flat spots in the map.

A second strategy to achieve four identifiable regions in the map is to form a diamond shaped path through the colour space. A light colour and a dark colour are chosen to form the top and bottom points of the diamond. Two extra colours from widely spaced locations in the gamut at a lightness level half way between the first two colours are used to complete the diamond shaped path. As with the zig zag path the fact that the sequence of colours are equally separated in lightness difference means that the four colours will end up being equally spaced in the colour map. A diamond shaped path passing through magenta, yellow green and blue is quite successful.



Two cyclic colour maps designed to have four identifiable regions. The magenta-red-yellow-blue map is constructed from a cyclic zig zag path and the magenta-yellow-green-blue map is formed from a diamond shaped path.

If one is prepared to accept a colour ambiguity corresponding to phase angles of 0 and 180 degrees then the principles used for diverging colour maps can be employed. One can construct a cyclic map that starts at a neutral colour, increases to a saturated colour, returns to the neutral colour, increases to a different saturated colour before returning to the neutral colour to complete the cycle. A white-red-white-blue-white colour map following this scheme is shown below. It is also possible to form a cyclic greyscale in a related manner. As with diverging colour maps smoothing of the lightness gradient reversals is required to prevent the creation of false features within the colour map. When interpreting data that has been rendered with such a colour map one has to resolve the ambiguities that occur at phase angles of 0 and 180 degrees by context.


Cyclic colour maps formed from a reversing greyscale path and from a reversing white-red-white-blue-white path.

As with diverging colour maps, for angular data to be rendered correctly it is important that the data values are respected so that values are correctly associated with specific entries in a cyclic colour map. The assignment of colours to values also needs to respect whether the data is cyclic over 180 degrees, as with orientation data, or over 360 degrees as with phase data. Results may be meaningless if the display routine normalises the angular data before rendering it with a cyclic colour map.

When rendering orientation data with a cycle length of 180 degrees it can be useful to perform a cyclic rotation of the colour map, corresponding to 25% of its length, so that the 'low' and 'high' regions of the colour map are aligned with the horizontal and vertical directions.


Cyclic colour maps rendered on the test image using a cycle length of 180 degrees. This corresponds to the use of the colour maps to encode orientation information.

The other factor to consider when displaying angular data is that it is also often associated with auxiliary data that might provide information about, say, its amplitude, reliability, or coherence. It can be useful to use this auxiliary data to modulate the colour map rendering of the angular data in some manner. The approach adopted here is to render the angular information with a chosen colour map and then, in RGB space, scale the colours towards black, or towards white, as a function of the associated auxiliary data. This modulation/desaturation allows the colour map encoding of the angular information to simultaneously represent this auxiliary data and, in doing so, suppress the visualization of angular data that is of low magnitude and/or reliability.


A signal composed of the sum of three chirps and its corresponding phase and amplitude scalograms. The phase values are rendered using a white-red-white-blue cyclic colour map. The phase and amplitude information can simultaneously encoded via colour saturation (bottom right).


Orientations of structures within the Total Magnetic Intensity Anomaly Grid of Australia. The orientation image is computed via monogenic filters (Felsberg and Sommer 2001) and the cyclic colour map values are modulated using the local local amplitude response of the filters and the local circular variance of orientations. Magnetic intensity data © Commonwealth of Australia (Geoscience Australia) 2003.

In summary, the design of good cyclic colour maps is challenging and requires careful thought. Perceptual and interpretation requirements have to be reconciled with colour space constraints and this cannot always be achieved to one's full satisfaction. The standard hue circle is a poor cyclic colour map and it is hoped that the alternatives presented here will provide more effective visualizations of angular information.


Colour Maps for Relief Shading

Relief shading can be an effective way of presenting data. By treating the data as if it was a 3D surface and generating the shading corresponding to the surface being illuminated from some direction we can use the eye's innate ability to interpret shading patterns to invoke a perception of the 3D shape. However, while interpretation of the data's 'shape' is enhanced, any sense of actual data values is diminished because shading only depends on the surface gradient.

The use of colour in conjunction with relief shading can provide a powerful enhancement to the perception of shape induced by the shading. In addition colour can also be used to convey information of of data value that is lost by relief shading. However, if colour is misused it is also potentially destructive to relief shading.

The main consideration when combining colour with relief shading is to ensure that the colour map does not interfere with the perception of features induced by the relief shading. A theoretical ideal is that the colour map be of constant lightness. The reason for this is that the perception of features within the data is provided by the relief shading. If the colour map itself has a wide range of lightness values within its colours then these may induce an independent shading pattern that could interfere with the relief shading. Having a colour map of uniform lightness will ensure orthogonality between the information induced by the colours and the information induced by the shading.

An interesting property of colour is that it can enhance the perception of 3D induced by relief shading. Shown below is a constant lightness colour map. On its own it tends to produce unattractive image renderings that are difficult to use. The sine wave features in the test image are very hard to discern.

When a shading pattern, in this case a diagonal sine wave, is overlaid with a circular sine wave pattern rendered with this colour map the resulting image induces a more compelling perception of 3D. It is the combination of colour gradients that are not aligned with the shading gradients that amplifies the 3D shading perception. See Kingdom (2003) for a description of this effect. Note that the shading pattern is applied to the colour image multiplicatively, we want the luminance of the colours to be modulated by the relief shading. This is in contrast to some implementations where the final image is obtained through a transparency blending of the relief shading and the colour image, a weighted sum. With an appropriate weighting between the two images one can obtain a result that looks visually plausible but nevertheless this is the wrong mechanism to use. See Appendix 1.

 x 

A shading pattern combined with an isoluminant image with colour gradients that are not aligned with the shading gradients produces an amplified 3D perception of the structure.

On the other hand if the circular sine wave pattern is rendered with a colour map having a significant lightness gradient the 3D structure induced by the original shading pattern is disrupted leading to a poor visualization. In the figure below notice how the diagonal shading bands are no longer uniform in their darkness. Also note where the darker blue regions lie alongside the the shading bands further compounding the confusion of the shading pattern. Compare this to the figure above and note how the shading of the image above has been left untouched by the colouring.

 ➞ 

Combining a shading pattern with an image having strong lightness variations can disrupt the perception of 3D structure.

This example probably represents a worst case scenario where the spatial frequency of the colour lightness variations is close to the relief shading variations thereby maximizing the potential interference. While the results shown above are interesting this synthetic example is not typical in that the shading pattern only has a single frequency component. Most data sets derived from natural data have an amplitude spectrum that decays inversely proportional to the frequency raised to some power. That is, the amplitude spectrum is roughly proportional to 1/f p where p is typically somewhere between 1 and 2 (Bak et al. 1987, Field 1987). If the relief shading pattern has a more distributed frequency spectrum of this form it appears that the colour-shading interaction effects that we see on a simple sinusoidal shading pattern are not necessarily so strongly reproduced.

Below is an example showing a DEM and a raw relief shading of the data. The amplitude spectrum of this particular relief shading image falls off at a rate roughly proportional to 1/f 1.2. To test how the frequency content of an overlaying image might interfere with the 3D shape perception the shading pattern was combined with a number of noise images having an amplitude spectrum of the form 1/f p. The noise images were grey to maximise any possible interference with the relief shading.

For p = 0.6 there is little interference with the overall 3D shape perception, though the high frequency content of the noise does mask some of the finer details. At the other end of the scale for p = 1.8 there is almost no interference with the shape perception. However, at a value of p = 1.2, when the noise amplitude spectrum is roughly matched to the spectrum of the relief shading, there considerable disruption to the 3D shape perception. Empirically it appears that as long as the image that is combined with the relief shading is not closely matched to the frequency spectrum of the relief shading then there is no special need to employ an isoluminant colour map. This is especially so if the image being combined with the shading pattern is of predominantly lower frequencies. However, obviously, if one uses a non-isoluminant colour map it should not have any very dark sections that could completely mask the relief shading altogether. This also depends, of course, on the scaling of gradient values used to generate the shading.

If the 1/f 1.2 noise image is rendered with an isoluminant colour map and combined with the relief shading then, as expected, there is no disruption to the 3D perception. However, any apparent amplification of the 3D perception, as was the case with the simple sine wave shading example, appears to be very limited if indeed there is any at all. It would appear that once the relief shading pattern is, in some sense, rich enough the addition of colour makes little difference.

 

 

 

 

 

Left to right, top to bottom: DEM image; raw relief shading of DEM;
1/f 0.6 noise image and shading rendered with the 1/f 0.6 noise image;
1/f 1.2 noise image and shading rendered with the noise. Note the disruption of the shading pattern;
1/f 1.8 noise image and shading rendered with the noise image;
1/f 1.2 isoluminant noise image and shading image rendered with the isoluminant noise image.

It is common to drape a colour image that has been derived from the data itself over the relief shading. The results presented above would indicate that this practice is valid and unlikely to create any perceptual problems. Forming a relief image from a data set is somewhat akin to taking a derivative of the surface. This has the effect of amplifying the spectral content of the image as a function of frequency. Thus the original data will have a stronger low frequency content than the relief shading image. In the example above the DEM amplitude spectrum falls away at approximately 1/f 1.7 whereas the amplitude spectrum of the raw relief shading image falls away at approximately 1/f 1.2. This difference appears to be more than sufficient to avoid any adverse interaction between the two. Another reason for expecting little interaction is that the image gradient values (and hence shading values) will, in general, be independent of the image data values themselves.

Log-log plot of the amplitude spectrum of the DEM and its relief shading image. The lines of best fit, from which the slopes are derived, are plotted in red.

 
 

Relief shading combined with images of the original DEM data rendered with a grey colour map and a low contrast green-brown-white colour map. Note that even with a grey colour map there is no disruption of the relief shading pattern and, in addition, the highest and lowest regions in the surface can still be identified.

An important advantage of combining relief shading with an image that has been derived from the data is that it allows the communication of overall data properties in addition to the local slope information. With just a raw grey scale relief image you only get a sense of the local surface normal information, you have no sense of the absolute data values. If the data range is very large this can be useful as the relief shading acts a form of dynamic range reduction allowing small scale features to still be seen within an arbitrarily large range of data values (assuming that shadows are not rendered as part of the relief shading). However, in other cases the loss of any sense of absolute data value can be a disadvantage. Overlaying an image derived from the data values overcomes this problem and allows the best of both worlds. In the renderings of the DEM data above the highest and lowest regions in the data can now be identified, even with the grey colour map.

Another example of the value of relief shading combined with a coloured image derived from the data is shown below. Using the residual gravity image of West Africa shown earlier we can see that, compared to a greyscale image of the data, a relief shaded image allows small scale structures to be identified readily. However, as with the grey scale image, it is hard to get a sense of the magnitude of the deviation of features above and below zero. Combining the relief shading with an image of the data rendered with a diverging colour map allows the fine structures to be seen in conjunction with the polarity of the data. Compare this result with the diverging colour map renderings of this data that were presented earlier.

 

Relief shading of residual gravity data of West Africa and the relief shading combined with a diverging colour map image. Note the use of a light colour map to compensate for the darkening induced by the shading.

Summary

Relief shading combined with a coloured image, even a grey scale image, can be a very useful way to present data. If the frequency content of the coloured image is significantly different from the relief shading then no particular precautions are needed with the colour map other than to ensure it does not have any significantly dark colours that could mask the shading altogether. However, as a general guide it is probably wise to use a low contrast colour map with a range of lightness values no more than, say, 50 to minimise any potential disruption to the shading pattern. In saying this one should note that the scaling of the gradient values used to generate the shading is arbitrary. If the scaling of gradients is small then sensitivity to non-isoluminance of the colour map will naturally increase. Finally, the colour map should also be composed of light colours because the shading process inevitably makes the overall image darker.

Combining a relief image with an image derived from the original data is typically safe because the relief image will generally have a significantly stronger high frequency content. However, if the image being combined with the relief shading is derived from another source (perhaps, say, one is wishing to overlay aeromagnetic information on DEM data) then it is possible that the frequency content of the two images may interfere. Should this be the case then an isoluminant, or very low contrast, colour map should be used.


Colours for Ternary Images

A ternary image is a colour image formed from three bands of a multichannel image. A basis colour is applied to each band and the images are summed to produce the final result. Almost invariably the RGB primaries of red, green and blue are used as the basis colours as this is the simplest and most obvious implementation. Multichannel Landsat imagery is commonly presented in this way. Ternary images are also used for rendering geophysical radiometric data whereby the potassium, thorium and uranium values are used to specify the red, green and blue components of an image respectively.

A difficulty with using the RGB primaries as basis colours is that the perceptual sensitivity of the eye to these colours is not equal. In particular the eye is quite insensitive to blue, having much fewer blue cones than green and red ones (Roorda and Williams, 1999). This is reflected in red, green and blue having very differing CIELAB lightness values of approximately 53, 88 and 32 respectively. Moreover, of equal importance is the relative lightness of the secondary colours that are obtained when the basis colours are mixed. Cyan, magenta and yellow have lightness values of 91, 60 and 97 respectively. If a data channel is assigned to green, or a combination of channels are directed to the yellow or cyan secondary colours, then these channels will be given an inappropriately large perceptual prominence over the others. Thus, the RGB primaries are not the ideal basis colours for forming ternary images.

The RGB primaries were designed to allow natural colours to be reproduced on display monitors. However our aims are different. We are not wanting to reproduce colours, instead we are seeking to create colours that convey information. Accordingly we want three basis colours that can be assigned to each channel of data in a way that allows all the information to be seen with equal perceptual prominence. We do not want any channel, or combination of channels, to be treated preferentially. To achieve this our ideal would be to have three basis colours that are nominally red, green and blue, that sum to white in RGB space, that are matched in lightness, and have the same chroma. The secondary colours resulting from these basis colours should also be matched in lightness and chroma. In practice this ideal cannot be attained but, with some effort, a workable compromise is achievable.

Designing an objective function to find a set of basis colours that maximally satisfy these requirements via an optimization search is complicated by the fact that we also want our basis colours to be not too dark, and that the resulting gamut of colours that can be created by the basis colours should be as large as possible. Accordingly, a manually guided optimization strategy was adopted. After some experimentation the following basis colours were constructed

'Red'    RGB: [0.90  0.17  0.00]    CIELAB lightness 50, chroma 92
'Green'  RGB: [0.00  0.50  0.00]    CIELAB lightness 46, chroma 71
'Blue'   RGB: [0.10  0.33  1.00]    CIELAB lightness 44, chroma 100.
The corresponding secondary colours have coordinates
'Cyan'          RGB: [0.10  0.83  1.00]    CIELAB lightness 79, chroma 43
'Magenta'       RGB: [1.00  0.50  1.00]    CIELAB lightness 72, chroma 78
'Yellow/Orange' RGB: [0.90  0.67  0.00]    CIELAB lightness 73, chroma 77.
The manually defined constraints were to set the 'green' basis colour to [0.0, 0.5 0.0] and to fix the red component of the 'red' basis colour at 0.9. The reasoning behind this choice for 'green' is that at a lightness level of around 45 this colour is most the heavily constrained in terms of chroma. Thus this colour has to be the maximal 'green' possible for a given lightness level. Fixing the red component of the 'red' basis colour at 0.9 was in recognition of the fact that in order to ensure a more uniform lightness of the secondary colours the red component has to be reduced from 1.0, but at the same time we want the gamut to be kept as large as possible. Finally, the blue component of the 'blue' was also fixed at 1.0. Given these constraints, and the condition that the colours sum to white, the unassigned green component of 0.5 and red component of 0.1 were then distributed between the basis colours via an optimisation search in order to minimise the lightness differences. This resulted in the colours given above.

With these choices the maximum lightness difference between any of the basis colours, or between any of the secondary colours, is kept to about 6. However, the maximum difference in chroma is larger than one would like at 35. Little can be done about this due to limits of the RGB gamut. Given the relative importance of lightness differences at fine spatial scales this compromise was deemed acceptable. By imposing different manual constraints the maximum lightness difference between the basis colours can be made arbitrarily small but the absolute lightness of the basis colours, and the gamut of colours that can be created from them, become unacceptably small.

Comparison of the RGB primaries (top left) and the proposed ternary basis colours (top right). Shown directly below are the lightness images of the corresponding colour images. Note how RGB green is very much lighter than RGB red which, in turn, is lighter than blue. In comparison the proposed basis colours are closely matched in lightness, as are their secondary colours.

The proposed new primary basis colours projected onto CIELAB space at a lightness level of 47 (left) and the corresponding secondary colours projected at a lightness level of 74 (right). The achromatic points are indicated by the red crosses.

The utility of the proposed basis colours can be evaluated by taking a dataset with three channels and, by forming all possible permutations of colour-channel assignment, creating six ternary images. While features will appear in each image with different colours we would like the salience of the features to be consistent across the images no matter what colour-channel permutation is used. As shown in the figure below this is closely achieved using the proposed basis colours. By avoiding any bias that might arise from choosing a particular colour-channel assignment this should allow a more consistent and reliable interpretation of data.


Top row: A series of radiometric images constructed using RGB red, green and blue as basis colours. The images show three, of the possible six, permutations of assignment of basis colours to image channels. Note how the salience of structures varies with the colour assignment permutation. In particular, structures encoded in green are given excessive prominence.
Bottom row: A series of radiometric images constructed as above but using the proposed 'red', 'green' and 'blue' basis colours. The salience of structures is much more consistent across the different colour-channel assignments.


Top row: A series of Landsat images constructed using RGB red, green and blue as basis colours. Bottom row: Images constructed as above but using the proposed 'red', 'green' and 'blue' basis colours. Again, note the consistency of the salience of structures with the new basis colours.

An inevitable consequence of using the proposed near-isoluminant basis colours is that the gamut of colours that can be represented is a reduced subset of the RGB cube. This is reflected in the more subdued colours in the ternary images shown in the figures above. However, what is gained is a more consistent representation of the data.

The gamut of colours that can be represented by the proposed basis colours displayed within the RGB cube.

Conclusion

This work presents a set of principled guidelines for the construction of perceptually uniform colour maps. The main factor to be considered is that, at the spatial frequencies of interest to us, the perceptual contrast in a colour map is dominated by colour lightness values. For most cases ensuring that a colour map has constant magnitude of lightness gradient is sufficient to ensure uniformity of perceptual contrast. However, if the colour map is of very low contrast, or isoluminant, such that hue and chroma need to be considered too then the colour map should have constant magnitude of CIE76 colour difference over its range. While neither the CIE76 or CIEDE2000 colour difference formulas were designed for the relatively high spatial frequencies we are interested in, empirically it would appear that the CIE76 colour difference formula is the best to use for colour maps with low lightness gradients. To support this work in the design of colour maps a test image is also presented. This test image allows the perceptual contrast of colour maps to be readily evaluated. It reveals that many colour maps supplied by vendors have serious deficiencies.

The specific design requirements for linear, diverging, cyclic, and rainbow colour maps are developed in detail. Where a colour map requires lightness gradient reversals they should be smoothed to avoid the creation of false anomalies in the map. The smoothing will induce a local perceptual flat spot in the colour map. However, even without smoothing any reversal of the lightness gradient still induces a perceptual flat spot because structures with data values that span the point of lightness gradient reversal in the map will be represented by nearly isoluminant colours. For this reason a linear-diverging blue-grey-yellow colour map may more effective to use than the more common blue-white-red diverging map. In some cases, particularly with cyclic colour maps, and to a lesser extent diverging ones, the perceptual and interpretation requirements of the colour map have to be reconciled with colour space constraints. It is not always possible to satisfy these requirements with complete satisfaction.

Relief shading and its interaction of colour is considered in detail. The conditions under which a colour image may, or may not, disrupt the 3D perception induced by the shading are identified. It is concluded that as long as the colour image being combined with the relief shading has an amplitude spectrum that is sufficiently different from the relief shading then no adverse interaction between the two will arise. However, is is preferable that the image being combined with the relief shading is of lower frequency content. Overall, the combination of colour with relief shading can be very effective.

Finally, the construction of ternary images from three basis colours is addressed. It is shown that the common use of RGB primaries as basis colours is not ideal because of the considerable differences in the perceptual lightness of these colours. Recognising the fact that are not wanting to reproduce colours but, instead, we are wanting to create colours that convey information an alternate set of basis colours are proposed for ternary images. It is demonstrated that with these basis colours the salience of structures is much more consistent no matter what assignment of basis colour to data channel is used.

A collection of MATLAB functions are available here for those wishing to replicate the results presented here and to design their own perceptually uniform colour maps.

In summary, it is hoped that this work brings some formalism to the process of designing and evaluating colour maps and that this will lead to more reliable and consistent interpretation of data.

Acknowledgment

This work is supported by the Centre for Exploration Targeting.

References and useful reading

This is incomplete



Return to CET Uniform Perceptual Contrast Colour Maps


Appendix 1:
CIE76 or CIEDE2000?

The CIE76 colour difference formula uses the Euclidean distance in CIELAB space as the measure of colour difference. Various shortcomings of this measure ultimately led to the development of the CIEDE2000 formula which incorporates correction factors that are applied to the differences in lightness, chroma and hue. The question arises whether the CIEDE2000 corrections should be used for the design of colour maps, and in particular, whether the lightness correction should be used.

CIEDE2000 lightness correction

CIEDE2000 incorporates an adjustment to the difference between CIELAB lightness values L1 and L2. Given the difference between the lightness values, ΔL, and their mean, L, the adjusted difference in lightness is given as:

Plot of the CIEDE2000 lightness difference correction factor 1/SL vs lightness, L.

This correction has the effect of downgrading the apparent perceptual difference in lightness at the extremes of the lightness scale to 57% of the raw difference in CIELAB lightness. That is, under the CIEDE2000 model, the difference in CIE lightness values at the dark and light ends of the scale need to be 1.75 times larger than at the centre to achieve uniform perceptual contrast. This might seem a significant difference from the CIE76 model. However, in practice, the difference is almost imperceptible, at least at the spatial frequencies we are interested in. Shown below is the test image rendered with greyscale colour maps designed to have constant rate of change in CIEDE2000 and CIE76. Depending on your monitor you may just see that the extreme dark and light sections of the test image have slightly more contrast on the CIEDE2000 colour map.

Greyscale constructed with constant CIEDE2000 contrast.

Greyscale constructed with constant CIE76 contrast.

CIEDE2000 chroma and hue correction

While, at the spatial frequencies we are interested in, the perceptual difference between colours is dominated by lightness it is also of interest to compare the two colour difference formulas in terms of hue and in chroma/saturation.

The CIEDE2000 chroma correction process starts by applying an adjustment to the a* components of the two colours to be compared (see Sharma et al. 2005 for details). From this two adjusted chroma values are computed using C' = √ a'2 + b*2 , where a' is the adjusted a* value. Given the difference between the adjusted chroma values, ΔC', and their mean, C', the adjusted difference in chroma is computed using:

The CIEDE2000 chroma difference value ΔC'/SC corresponding to 1 unit of chroma in CIELAB space plotted as a function of chroma. Note that the function varies with hue angle due to a correction that is applied to a*.

This correction noticeably emphasizes the contrast in high chroma regions at the expense of the low chroma sections. Depending on the hue angle, at a chroma value of 100, the difference in raw CIELAB chroma needs to be between about 5.5 and 8 times as great than it does for nearly neutral colours to achieve the same measure of CIEDE2000 chroma contrast.

Evaluating this on the test image reveals that this correction does not appear to suit our needs at the spatial frequencies of interest to us. The example shown below is for an isoluminant grey-to-red colour map with a hue angle of about 40° and chroma ranging from 0 to 100. As features are hard to see on an isoluminant colour map the amplitude of the sine wave in the test image has been increased from 12.5 to 50 levels out of 256. It is quite clear that use of the CIE76 formula provides a colour map with a much more even perceptual contrast.

Isoluminant, increasing chroma colour map constructed with constant CIEDE2000 contrast. Note the large difference in perceptual contrast between the high and low chroma sections of the colour map.

Isoluminant, increasing chroma colour map constructed with constant CIE76 contrast.

To test the two formulas on hue, to the exclusion of other factors, one can construct a circular isoluminant colour map path in CIELAB space. This gives a constant lightness and constant chroma colour map that only varies in hue. Application of the two formulas on such a colour map path produce nearly identical colour maps. Visually the differences are imperceptible. This is to be expected as the hue correction introduced in the CIEDE2000 formula is relatively small with its primarily effect only in the blue region.

Summary

Overall, for our purposes, CIE76 would appear to be the most appropriate colour difference formula to use. While the lightness correction in CIEDE2000 is probably useful its effect is barely noticeable. This is more than offset by the formula's chroma correction that does not seem to be appropriate at the spatial frequencies of interest to us. Another (minor) factor against the CIEDE2000 formula is that it has some small discontinuities in its hue component (Sharma et al. 2005). Given the mostly orthogonal nature of the corrections to the colour difference components there might be a case for employing the CIEDE2000 lightness difference correction on its own and leaving chroma and hue differences to be computed using CIE76. However, this option has not been adopted given that the difference is marginal and CIE76 is so simple to apply. Ultimately one should remember that neither colour difference formula was designed for the spatial frequencies we are interested in.

Appendix 2:
Combining relief shading with a colour image

Combination via multiplication

To model the shading of a surface that has been overlaid with a colour image the red, green and blue components of a point in the colour image should be modulated by the corresponding shading value at that location. Thus if the shading image is s and the colour image has components r, g and b then, trivially, the final image has components [sr sg sb] .

 x 


Combination via weighted sum

In a number of software packages the only way to combine a colour image with a shading pattern is via a transparency blending of the two images. If one thinks of the shading image as a colour image with identical red, green and blue channels of value s then the weighted sum of the shading image and the colour image can be expressed as:

w[s s s] + (1-w)[r g b] = [w(s-r)+r   w(s-g)+g   w(s-b)+b]

where w is the weight applied to the shading image.

Clearly this expression does not correctly model the shading of a surface that has been overlaid with a colour image. Note in the figure below how changing the weighting factor affects the perception of the magnitudes of the gradients on the surface.

   

Examples of combining shading and a colour image via a weighted sum. From left to right the shading image weights are 0.3, 0.5 and 0.7.