Perceptually Uniform Color Maps in Satellite Imagery

Plenty of colorful options to communicate the message through EO data

Keenan Ganz
Sentinel Hub Blog
6 min readJan 28, 2021

--

A guest blog post by Keenan Ganz

Foreword by Sentinel Hub

This post is part of a series of guest blog posts written by script authors, talking about their entries to the Sentinel Hub Custom Script Contest. Keenan Ganz is among the winners in the third round of the Contest. His winning script with detailed description is available on our GitHub repository.

Color maps are the backbone of data visualization. Simply put, a color map relates a data value on an arbitrary scale to a set of colors shown to the observer. When done well, color maps make science beautiful and informative.

For satellite images, we can often show images as a composite of several bands. In this case, a color map is not necessary. But, there are many occasions when satellite bands combine to produce a single-channel image like a normalized-difference index, change-over-time, and so on. When this is true, we have to be careful about how data is visualized.

Before getting into the script, let’s discuss common data visualization pitfalls. Remember that the point of any visualization is to represent numeric information in a medium that humans are better at perceiving than a table of numbers. First, consider the humble rainbow:

The most important thing to take away from this post is this: stop using rainbow color maps. To understand why, answer this question without looking at the above picture: how many times greater is pink than yellow? The correct answer on the above scale is about 4 times. If you guessed correctly, you are in the minority: research shows that people generally overestimate their ability to read a rainbow color map¹. But really, that question is nonsensical. Colors follow an order but they do not carry numerically comparable information. Recall that color maps relate visual information to quantitative information. If rainbows are not inherently quantitative, it should come as no surprise that they are a poor choice for a color map.

Another problem arises from the distinct bars in the above color map at 0.20, 0.50, and 0.80. These are artifacts which suggest that a difference in data space from 0.10 to 0.25 is much greater than from 0.25 to 0.40 even though the distance between those points in data space is exactly the same. Artifacts in the color map will propagate into the visualization. Compare these two images:

They were produced with the same data! Yet, the visualization with the rainbow seems to have objects that disappear in the grayscale version. Are these true trends in the data or just a figment of our perception. Depending on the color map, our interpretation of data can radically change!

Rainbows are not the only problem with conventional data visualization. A more detailed discussion is available in Knowable Magazine² and Annual Reviews³.

Research tells us that certain visualizations play better to the human brain than others. Geometric attributes — like length, area, and angle — are generally easier to perceive than differences in brightness or hue. The use of colors is made even more difficult by the fact that not all computer displays are the same and the fact that some of your observers may be color blind. Visualizing satellite data, which is almost always displayed as an image, is made especially difficult by the requirement to satisfy all of these aforementioned needs.

How do we make good color maps? For visualizing an image, changes in lightness are easier to perceive than changes in hue or saturation². To make a color map with a uniform lightness change, we need to work in a color space different from RGB. You might think that lightness in RGB space would simply be distance from (0, 0, 0), but this is not the case. Remember that the human eye does not perceive the world in terms of red, green, and blue. Perceptual studies have determined reference values of red, green, and blue that correspond to specific lighting conditions⁴. Instead of juggling these reference values, CIELAB color space is a much easier choice. CIELAB is defined by three axes: L, a, and b. The L axis, which stands for lightness, gives us a direct way to control color lightness. The other axes determine the color’s hue in terms of the four colors of human vision: red, green, blue, and yellow.

My script on Sentinel Hub implements three color map variations: linear, divergent, and isoluminant. In code, these are as easy to use as the default visualizer. Simply provide your data anchors and the corresponding RGB colors for those data values, and the script will map the colors into CIELAB space and apply the lightness correction you want to use. When visualizing, the script will determine the CIELAB color that corresponds to your data value and map that CIELAB color back into RGB space.

There is one limitation that results from the fact that CIELAB color space is larger than RGB color space. A color might be pushed outside of the valid RGB range when the lightness correction is applied. In this case, values are clipped to ensure they are within RGB space.

The linear color map has a constant change in lightness from two extremes. Since the perception we rely on is changes in lightness, it is best to have as large a lightness gradient as possible. You can add different hues at intermediate anchors along the color map to introduce more colors.

White-green normalized difference vegetation index (NDVI) with a water mask over Sequim, WA, USA.

The divergent color map is similar: the edges of the color map have the same lightness while the color in the center is the minimum or maximum of the whole map. Divergent color maps are useful to show variation around a central value (increase/decrease, comparison to an average, etc.).

Hurricane Matthew temperature with a red-white-blue divergent color map.

Finally, the isoluminant color map enforces the same lightness across the whole color map. Lightness is determined by taking the mean lightness of all colors provided to the map. This makes it easy to show categories side-by-side. An added remote sensing bonus for the isoluminant color map is that one can overlay a semi-transparent hillshade raster to visualize terrain.

NDVI categorized as forest (green), water (blue), or urban (gray) in the Hudson River valley over Troy, NY, USA. Hillshade overlay is derived from elevation data collected by the New York State GIS Clearinghouse.

With these tools, you can produce quality figures from satellite images that are less likely to suffer from hard-to-understand scales or data artifacts. The mathematics of the color conversion is documented in the script and are readily usable on other applications.

Find the PUCK script here and communicate through maps!

References

[1] Borkin, Michelle A., et al. Evaluation of artery visualizations for heart disease diagnosis. IEEE Transactions on Visualization and Computer Graphics, vol. 17, no. 12, December 2018, pp. 2479–2488. doi:10.1109/TVCG.2011.192

[2] O’Donoghue, Sen I., et al. Visualization of Biomedical Data. Annual Review of Biomedical Data Science, vol. 1, no. 1, 2018, pp. 275–304. doi:10.1146/annurev-biodatasci-080917–013424.

[3] Mason, Betsy. Why Scientists Need to Be Better at Data Visualization. Knowable Magazine, Annual Reviews, Nov. 2019. www.knowablemagazine.org, doi:10.1146/knowable-110919–1.

[4] CIE Publication № 015: Colorimetry. Central Bureau of the CIE, Vienna (2004)

The Sentinel Hub team would like to thank Keenan for his participation in our Contest.

To learn more about satellite imagery and custom scripting we recommend you to check the Sentinel Hub Educational page and Custom Scripts webinar. You can also visit a dedicated topic at the Sentinel Hub Forum for further information. We would also like to invite you to take a look at the other scripts submitted to the Sentinel Hub Custom Script Contests, available here.

--

--