0

So I have a tif and it has a black internal padding or stuff.

-------
--***--
--***--
--***--
--***--
-------

So the * are the needed bit, the - however, I need to get rid of.

After few web searches, I came across gdaldem I have been using it like

gdaldem color-relief -exact_color_entry input.tif style.txt -alpha output.tif

The style.txt looks like this

0 0 255 0 100 // wanted 0 0 0 0 ideally

So this will convert 0 value to green color with an alpha of 100, but it would not convert any other color, what I desire is something like this

0              0 0 0 0
anything_else  no_change

How do I do this ?

  • gdal_edit -a_nodata 0 input.tif ? – mikewatt Sep 6 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.