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 • 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.

Observations • James Banting

STACLint: Validate your STAC

STACLint is an online validation tool for STACs. With it, you are able to validate STAC catalogs, collections, and items by supplying either a URL or JSON. The…

Observations • James Banting

COG—Huh! What is it good for?

Cloud Optimized GeoTIFF (COG) are geotiff files, like satellite imagery, that have been processed in a manner that makes it easy to consume for internet processing applications (read…

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