[Gdal-dev] src/dstnodata not effective for indexed colour

Ed McNierney ed at topozone.com
Fri Jan 26 14:46:31 EST 2007

Matt -

It isn't possible for me to test this right now, but I would expect that
for your indexed input file your -srcnodata value would be the INDEX
value you want to be treated as "no data", rather than the RGB value
associated with that index value.

     - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 (978) 251-4242
Fax: +1 (978) 251-1396
ed at topozone.com 

-----Original Message-----
From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of Matt Wilkie
Sent: Friday, January 26, 2007 2:19 PM
To: gdal-dev at lists.maptools.org
Subject: [Gdal-dev] src/dstnodata not effective for indexed colour


When using gdalwarp source and destination nodata parameters on an RGB
image one can remap the values (e.g. change nodata from 255,255,255 to
0,0,0 or 255,0,0 or ...). This doesn't appear to work with indexed
colour images. Is this by design, a bug, or just not implemented?

# this works, pixels which are 255 (white) in input # will be 150 (grey)
in output gdalwarp -srcnodata "255 255 255" -dstnodata 150 rgb.tif

# doesn't work, source values of 255 (white) remain unchanged in output
gdalwarp -srcnodata "255 255 255" -dstnodata 150 indexed.tif


matt wilkie
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax

Gdal-dev mailing list
Gdal-dev at lists.maptools.org

More information about the Gdal-dev mailing list