Maybe it's just Friday, but I could use a pointer here :-) My input raster is a RGBA byte image, where the alpha channel value is 0 or 255 (ie: effectively a mask). The output is ideally a VRT file, RGB with Int16 data type, using nodata=-1.
So I want to convert the alpha channel to a nodata value. The alpha/nodata/mask/band options to translate/warp haven't got me very far, neither has hand-crafting various UseMaskBand/MaskBand elements in a VRT. I can do it to concrete tif files with something like this, repeating for R,G,B and merge the output bands together, but it's a lot of processing. gdal_calc.py -A src.tif -B src.tif \ --outfile out_b1.tif --co TILED=YES --type=Int16 --NoDataValue=-1 \ --A_band=1 --B_band=4 --calc="where(B >= 128, A, -1)" I feel like I'm probably missing a simpler path? (Which I will definitely add to an Examples section somewhere) Thanks, Rob :)
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev