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

Matt Wilkie matt.wilkie at gov.yk.ca
Fri Jan 26 14:19:13 EST 2007


Hi GDAL,

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 grey-nodata.tif

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


cheers,

-- 
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
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------




More information about the Gdal-dev mailing list