[gdal-dev] gdalwarp color table copy issue

Even Rouault even.rouault at mines-paris.org
Thu Sep 4 14:43:49 EDT 2008


You're hitting two issues :
- First issue. You shouldn't use gdalwarp on a dataset with a color table and 
try a resampling method that is not nearest neighbour (basically because all 
other resampling methods do some math like averaging with several values of 
pixels. Which doesn't make sense for a color table index) . I've added very 
recently a warning in GDAL 1.6.0dev to warn the user in such cases.
- Second issue. TIFF format (it's really a format limitation) doesn't handle 
the transparency component in a color table. Basically the alpha component is 
always 255.

The solution I see : convert your dataset to a full RGBA image and warp it 
afterwards. You can do that easily with the -expand rgba option of 
gdal_translate from GDAL 1.6.0dev.


More information about the gdal-dev mailing list