<div dir="ltr">Maybe it's just Friday, but I could use a pointer here :-) <div><br></div><div>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.</div><div><br></div><div>So I want to convert the alpha channel to a nodata value. </div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div><font face="monospace">  gdal_calc.py -A src.tif -B src.tif \<br>    --outfile out_b1.tif --co TILED=YES --type=Int16 --NoDataValue=-1 \<br>    --A_band=1 --B_band=4 --calc="where(B >= 128, A, -1)"<br></font><br></div><div>I feel like I'm probably missing a simpler path? (Which I will definitely add to an Examples section somewhere)</div><div><br></div><div>Thanks,</div><div><br></div><div>Rob :)</div></div>