[gdal-dev] Detect alpha or nodata in tiff

Javier Jimenez Shaw j1 at jimenezshaw.com
Tue Apr 6 13:11:26 PDT 2021


Hi all

I am running "gdal2tiles" over input GeoTIFF from the command line.
Some times those geotiff may have an alpha band (usually and RGBA uint8
image), or nodata value (usually a float32 image), or sometimes none of
them. In the last case I will add the option "-a 0,0,0" or "-a 0" (yes,
black is the new transparent), but on the other two cases I shouldn't add
that option.

Is there any efficient way via the command line to detect if a file has
some kind of transparency mask, apart for parsing the output of gdalinfo?

Thanks
.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210406/ee516800/attachment.html>


More information about the gdal-dev mailing list