[gdal-dev] JPEG compressed COGs nodata

Travis Kirstine traviskirstine at gmail.com
Fri Jul 22 09:03:54 PDT 2022


To answer my own question I believe the answer is that you need to create
an alpha band when working with RGB datasets to have JPEG compressed COGs
without compression artifacts in the nodata areas.  Creating a internal
mask on the source data may work as well but I haven't tried.

# add a alpha band using the nearblack utility
nearblack -setalpha rgb_nodata.tif -o rgba.tif
# create the COG
gdal_translate -of COG  -co COMPRESS=JPEG -co
TILING_SCHEME=GoogleMapsCompatible -co NUM_THREADS=ALL_CPUS -co BIGTIFF=YES
rgba.tif cog.tif

Regards




On Tue, 19 Jul 2022 at 15:19, Travis Kirstine <traviskirstine at gmail.com>
wrote:

> I've been trying to create a COG with JPEG compression with transparent
> nodata values without much success.  Is this possible without creating a
> secondary mask?
>
> Any hints?
>
> Regards
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220722/23b27574/attachment.htm>


More information about the gdal-dev mailing list