[ Beneath the Waves ]

Gradient-Mapped False Colour Images

article by Ben Lincoln

 

A colour gradient is a map in which there are smooth transitions between one or more colours. Usually they are one-dimensional, although when used in graphics software there are often options for mapping to one-dimensional gradient into a two-dimensional space (for example, causing the gradient to radiate outwards from a center point).

Using a gradient to colourize a greyscale image (by mapping the lowest values in the image to one end of a gradient and high values to the other) as a special case of indexed images (those that use palettes/colour look-up tables instead of discreet per-pixel RGB, CMYK, or other colourspace coordinates) has a long history in the imaging world. I have been unable to find out where and when their use originated, but early episodes of Space: 1999 feature mock-thermographic imagery rendered in this manner, which gives an upper bound for their invention of 1974.

Thermography is one of the most common places that members of the general public will have seen gradients in use in this manner, especially in action/sci-fi films such as Predator (and its sequels[1]), and Heat. Sadly, I don't have access to a thermal imager yet, but I have faked a thermal image for use as an example by using the hue channel from a colour image I shot of a fluorescent liquid against a non-fluorescent background. In this case, the hue channel was a fairly good match for the strange "flat" look that thermal images have due to every object illuminating every other object, and a lack of shadows.

Faux Thermograph Gradient Examples
[ RGB ]
RGB
[ Hue [Grey] ]
Hue [Grey]
[ Saturation [Grey] ]
Saturation [Grey]
[ Value [Grey] ]
Value [Grey]
[ Hue (Inverted) [Grey] ]
Hue (Inverted) [Grey]
[ Classic Thermograph ]
Classic Thermograph
[ Intense Thermograph ]
Intense Thermograph
[ Modern Thermograph 1 ]
Modern Thermograph 1
[ Modern Thermograph 2 ]
Modern Thermograph 2
[ Modern Thermograph 3 ]
Modern Thermograph 3
[ Gradient List ]
Gradient List
       

In this set of example images, the hue channel from a colour image is inverted and then used as a simulated thermograph, with a variety of gradients applied.

Date Shot: 2010-05-21
Camera Body: Nikon D70 (Modified)
Lens: Unknown
Filters: Standard Set
Date Processed: 2011-01-15
Version: 1.0

 

These are just a few examples of the essentially infinite number of gradients that can be applied to a greyscale image. In this specific case, the gradients are not intended to represent an absolute value, but simply to show the progression from low values to high values.

In addition to providing a more visually interesting result, using a gradient to represent values has a number of benefits. Gradients can be used to delineate between various thresholds, such as positive versus negative values, or specific increments of temperature (negative and zero temperature being represented in shades of blue, temperatures between 1 and 99 degrees appearing as greyscale or green, and temperatures above 100 degrees rendered in shades of red, for example[2]).

Here is an example in which two simple gradients are used to indicate where values (skewness and kurtosis) in an image are positive or negative:

Charred Paper Statistical Image Gradient Examples
[ Kurtosis (WS01) [Grey] ]
Kurtosis (WS01) [Grey]
[ Kurtosis (WS03) [Grey] ]
Kurtosis (WS03) [Grey]
[ Kurtosis (WS05) [Grey] ]
Kurtosis (WS05) [Grey]
[ Kurtosis (WS01) - Doppler Shift White [Gr] ]
Kurtosis (WS01) - Doppler Shift White [Gr]
[ Kurtosis (WS03) - Doppler Shift White [Gr] ]
Kurtosis (WS03) - Doppler Shift White [Gr]
[ Kurtosis (WS05) - Doppler Shift White [Gr] ]
Kurtosis (WS05) - Doppler Shift White [Gr]
[ Kurtosis (WS01) - Doppler Shift Black [Gr] ]
Kurtosis (WS01) - Doppler Shift Black [Gr]
[ Kurtosis (WS03) - Doppler Shift Black [Gr] ]
Kurtosis (WS03) - Doppler Shift Black [Gr]
[ Kurtosis (WS05) - Doppler Shift Black [Gr] ]
Kurtosis (WS05) - Doppler Shift Black [Gr]
[ Skewness (WS01) [Grey] ]
Skewness (WS01) [Grey]
[ Skewness (WS03) [Grey] ]
Skewness (WS03) [Grey]
[ Skewness (WS05) [Grey] ]
Skewness (WS05) [Grey]
[ Skewness (WS01) - Doppler Shift White [Gr] ]
Skewness (WS01) - Doppler Shift White [Gr]
[ Skewness (WS03) - Doppler Shift White [Gr] ]
Skewness (WS03) - Doppler Shift White [Gr]
[ Skewness (WS05) - Doppler Shift White [Gr] ]
Skewness (WS05) - Doppler Shift White [Gr]
[ Skewness (WS01) - Doppler Shift Black [Gr] ]
Skewness (WS01) - Doppler Shift Black [Gr]
[ Skewness (WS03) - Doppler Shift Black [Gr] ]
Skewness (WS03) - Doppler Shift Black [Gr]
[ Skewness (WS05) - Doppler Shift Black [Gr] ]
Skewness (WS05) - Doppler Shift Black [Gr]
[ Gradient List 2 ]
Gradient List 2
 

These two series of images illustrate how gradients can provide a visual distinction between positive and negative values. Notice how nearly all of the kurtosis values are negative, whereas the skewness values are a mixture of both positive and negative. This is not at all obvious in the original greyscale images.

Date Shot: 2011-01-01
Camera Body: Nikon D70 (Modified)
Lens: Nikon Micro-Nikkor 105mm f/4
Filters: Standard Set
Date Processed: 2011-01-01
Version: 1.0

 

A conceptually-similar result is achieved in these vegetation index satellite images of New York City. However, these gradients are biased, so that instead of zero being in the center, it is 1/4 of the way from the minimum. This is because everything I've read indicates that it is positive values in this type of image that are important, so more fidelity has been allocated to those values.

As with the skewness and kurtosis images, the values are relative only to zero. The minimum is whatever the lowest value in the image happened to be, and the maximum is whatever the highest value happened to be. They do not represent, for example, values between -1.0 and 1.0.

Vegetation Index Gradient Examples
[ GEMI (Full Range) [Grey] ]
GEMI (Full Range) [Grey]
[ GEMI (Positive) [Grey] ]
GEMI (Positive) [Grey]
[ GEMI (Negative) [Grey] ]
GEMI (Negative) [Grey]
[ GEMI - Vegetation Index Single Scale [Gr] ]
GEMI - Vegetation Index Single Scale [Gr]
[ GEMI - Vegetation Index Dual Scale [Gr] ]
GEMI - Vegetation Index Dual Scale [Gr]
[ GEMI - Vegetation Index Triple Scale 1 [Gr] ]
GEMI - Vegetation Index Triple Scale 1 [Gr]
[ GEMI - Vegetation Index Triple Scale 4 [Gr] ]
GEMI - Vegetation Index Triple Scale 4 [Gr]
[ ARVI (Full Range) [Grey] ]
ARVI (Full Range) [Grey]
[ ARVI (Positive) [Grey] ]
ARVI (Positive) [Grey]
[ ARVI (Negative) [Grey] ]
ARVI (Negative) [Grey]
[ ARVI - Vegetation Index Single Scale [Gr] ]
ARVI - Vegetation Index Single Scale [Gr]
[ ARVI - Vegetation Index Dual Scale [Gr] ]
ARVI - Vegetation Index Dual Scale [Gr]
[ ARVI - Vegetation Index Triple Scale 1 [Gr] ]
ARVI - Vegetation Index Triple Scale 1 [Gr]
[ ARVI - Vegetation Index Triple Scale 4 [Gr] ]
ARVI - Vegetation Index Triple Scale 4 [Gr]
[ Gradient List 3 ]
Gradient List 3

Similar to the kurtosis and skewness examples, gradient-mapping these vegetation index images of New York City from space allows negative and positive values to be displayed intuitively in the same image. In this case, the high-contrast colours make it extremely obvious that the Global Environmental Monitoring Index and Atmosphere-Resistant Vegetation Index return noticeably different values from the same input data.

 

By using a gradient in which the colour "wraps around" back to its starting value, it becomes possible to more intuitively and accurately represent "circular" values such as phase, the angle of linear polarization, or hue. I don't have equipment that can capture phase or polarization values, but here are a pair of examples in which I've converted an RGB colour image into HSV (hue/saturation/value) colourspace values. When viewed as greyscale, the hue images fail to convey an important aspect that show up very clearly in the gradient-mapped version: that values which are close to the "maximum" (360 degrees, or 2 pi radians, depending on how you're counting) are also close to the "minimum" (0 degrees/radians). This appears up as a confusing and visually unpleasant discontinuity in the greyscale images, but a smooth transition in the gradient-mapped versions.

Marf Century Gradient Example 1
[ R-G-B ]
R-G-B
[ Hue [Grey] ]
Hue [Grey]
[ Saturation [Grey] ]
Saturation [Grey]
[ Value [Grey] ]
Value [Grey]
[ Hue [Gr] ]
Hue [Gr]
[ Gradient List 4 ]
Gradient List 4
[ The Hue Wheel ]
The Hue Wheel
     

In this second set of example images, the hue channel is instead mapped to a "circular" gradient that displays values near 0 degrees (or 360 degrees, if you prefer) as a smooth transition, instead of the discontinuity that appears in the greyscale version.

Date Shot: 2010-02-20
Camera Body: Nikon D70 (Modified)
Lens: Nikon Nikkor 28mm f/2.8 (CRC)
Filters: Standard Set
Date Processed: 2011-01-15
Version: 1.0

 
Marf Century Gradient Example 2
[ R-G-B ]
R-G-B
[ Hue [Grey] ]
Hue [Grey]
[ Saturation [Grey] ]
Saturation [Grey]
[ Value [Grey] ]
Value [Grey]
[ Hue [Gr] ]
Hue [Gr]

A second example of the circular gradient, because Marf Century wants all his friends back home in pretend-Kalamazoo to be jealous of his medallion.

Date Shot: 2010-02-20
Camera Body: Nikon D70 (Modified)
Lens: Nikkor-Q 135mm f/2.8
Filters: Standard Set
Date Processed: 2011-01-15
Version: 1.0

 

Finally, here is some genuine thermal imagery courtesy of OnEarth - this is a heat map of Big Bend National Park from space.

Thermal Imagery of Big Bend
[ Thermal [Grey] ]
Thermal [Grey]
[ Classic Thermograph [Gr] ]
Classic Thermograph [Gr]
[ Modern Thermograph 1 [Gr] ]
Modern Thermograph 1 [Gr]
[ Modern Thermograph 2 [Gr] ]
Modern Thermograph 2 [Gr]
[ Modern Thermograph 3 [Gr] ]
Modern Thermograph 3 [Gr]
 

 

 
 
Footnotes
1. I am reasonably certain that Predators, despite being the best film of the franchise in every other respect, faked the thermographic look. To my knowledge, the crews on all of the other entries in the series (including the Alien versus Predator spinoffs) used actual thermal imagers to shoot the "Predator POV" footage.
2. I am referring to the temperature in celsius, of course.
 
[ Page Icon ]