I have an RGB GeoTIFF file and I want to convert a specific RGB colour to transparent. I would like to use GDAL for doing this, but external Python scripts are also an option (though I haven't learned the art of Python scripting yet).
My thoughts are:
- Add a 4th band to my GeoTIFF file and fill with 255.
- Insert 0 into the 4th band where RGB colour == target colour
The first part I think I can solve using
gdalwarp -dstalpha source.tif target.tif
The second though I don't know how to solve. matt wilkie suggest using a Python script he wrote, but I think that is done separately for each band and not for a specific colour.
How can I assign a value to the 4th band of my TIFF when the RGB colour is equal to a specific RGB colour?
No comments:
Post a Comment