Image with nodata displayed over google basemap

Same image after making nodata transparent

What’s all the racket?

These little artifacts along the edge of the data look like they should be considered nodata however they show up despite setting the nodata to be transparent. Turns out these cells are slightly off-white and were likely introduced during JPEG compression. This can happen with both 0 (black) and 255 (white) nodata values.

Luckily GDAL has a handy tool to deal with this: nearblack. Nearblack takes all the cell values that are nearly black, or in this case white, and coverts them to true black or white.

Here is the code I used in the command line on the image above:

nearblack -white -o output.jpg input.jpg

Note: the –white is required because the artifacts in this particular image are white.

and look at it now. It’s a real beaut
Sharing options

Observations • Tomer Rockman

STAC it up – A STAC tutorial

In this post we describe the process of taking a federal Canadian dataset and creating a SpatioTemporal Asset Catalog (STAC) using python.

Observations • Will Cadell

Open Innovation in Geospatial

When we think about open innovation, it is easy to think we mean sharing everything. That is not quite the idea. For me, open innovation is sharing the…

Observations • Dustin Sampson

From Many to One: A Map Creation Story

A journey of creating a vessel tracking web map from a series of static vessel map images.

Need a geospatial partner?

Our team complements organizations like yours—by providing on-tap access to geospatial, analytics, and mapping expertise.

Let’s talk

Join our team?

We’re always looking for skilled technologists to help us build the future of geospatial. Got a minute to find out more about us?

Working Here

Sharing options