Optimized raster color corrections with rio-color

Matthew Perry
Fri, 20 May 2016 00:00:00 -0400

Last week we launched rio-color – an open source Rasterio plugin for color adjustment of geospatial rasters. We’re using it as part of our production image processing chain to keep our satellite basemap looking great and running smoothly.

Rio-color exists for one reason: to correct and adjust colors of geospatial imagery. Satellite, UAV and aerial photography comes to us from dozens of different sources. The color balance differs depending on the weather, the air quality, the seasons, the time of day, the sensor used to take the image, and so on. All this imagery has to be adjusted to be accurate, consistent and visually appealing across the global basemap at all zoom levels.

Rio-color provides three basic color operations: sigmoidal contrast, gamma adjustment and saturation. These can be applied to an input raster dataset in various combinations to produce the desired color balance.

Sigmoidal adjustment can alter the contrast and brightness of an image in a way that matches human’s non-linear visual perception. It works well to increase contrast without blowing out the very dark shadows or already-bright parts of the image.

Gamma adjusts color values according to a power law, effectively brightening or darkening the midtones. It can be very effective in satellite imagery for reducing atmospheric haze in the blue and green bands.

Saturation can be thought of as the “colorfulness” of a pixel. Highly saturated colors are intense and almost cartoon-like, low saturation is more muted, closer to grayscale. You can adjust saturation independently of brightness and hue, but the data must be transformed out of the RGB color space.

These three operations can be composed to do most of the color manipulation necessary to make imagery look better, more realistic and more consistent across our basemap.

Rio-color was designed specifically for large remote sensing jobs where geospatial referencing, memory usage, concurrency, efficiency and scalability are critical. It is one of a growing number of Rasterio plugins, a suite of raster data processing modules using Rasterio as a common framework.

Camilla, Damon, Sean, and Virginia will be in Portland the week of May 30th for the PyCon conference, where they will be working on Rasterio plugins and other parts of the Python mapping stack. Stop by and say hello!