[Gdal-dev] Changing color values

Frank Warmerdam warmerdam at pobox.com
Mon Nov 14 12:22:41 EST 2005


On 11/14/05, Bjoern Ruff <br at forstware.de> wrote:
> Hello,
>
> is there a tool giving a easy way to change single colors in an image?
> E.g.: Change all black pixels to white.

Bjoern,

Do you just want to change a color in a paletted applied to
a one band image, or are you wanting to change the
underlying value of the pixels?

Changing palettes can be accomplished by translating to VRT
format, manually editing the .vrt file, and then translating back to
the original format.

Modifying particular pixel values can be accomplished
with the gdal/pymod/samples/val_repl.py python script
as long as you have Python support built for GDAL.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list