GDAL - replacing rgb value (0,0,0) with (nodata,nodata,nodata)

المشرف العام

Administrator
طاقم الإدارة
I have a set of rasters in which I want to replace any rgb value of (0,0,0) with (nodata,nodata,nodata)

I've tried using

gdal_translate -a_nodata "0,0,0" in.tif out.tifBut this seems to convert all 0s to nodata, for example (0,10,10) becomes (nodata,10,10). I want these to stay the same and only convert (0,0,0) to (nodata,nodata,nodata).

I'm looking for any solutions using gdal tools like gdal_translate or gdalwarp that I can add into a larger shell script.

Thanks,



أكثر...
 
أعلى