[GIS] GeoTiff convert to PNG with transparency

arcgis-desktoparctoolboxgdalgeotiff-tiffpng

I need to convert a GeoTIFF image to PNG format with "NoData" pixels in the original image being transparent in the output.

Is there any tool particularly in ArcGIS ArcToolbox or GDAL for this purpose?

Best Answer

In Windows:

for %i in (*.tif) do gdal_translate -of GTIFF -a_nodata 0 %i %~new_ndata.tif
for %i in (*.tif) do gdal_translate -of PNG -scale -co worldfile=yes %i %~cnvt.png

In bash:

for i in *.tif; do gdal_translate -of GTIFF -a_nodata 0 $i $i~new_ndata.tif; done; for i in *~new_ndata.tif; do gdal_translate -of PNG -scale -co worldfile=no $i $i~cnvt.png; done;