[gdal-dev] About palette/color table expansion

Even Rouault even.rouault at mines-paris.org
Wed Aug 6 17:49:44 EDT 2008


just a few words to advertize the new capability of color table expansion that 
has been added recently to GDAL trunk (1.6.0dev).

A new option of gdal_translate, -expand rgb|rgba, enables the user to ask for 
the expansion of a single band dataset with a color table and its translation 
to a 3 or 4 band dataset with the R,G,B,A components. Usefull for output 
drivers such as JPEG, JPEG2000, MrSID, ECW that don’t support color indexed 

That capability relies on an extension of the VRTComplexSource that adds an 
extra optionnal attribute  

You can use color table expansion to warp color indexed datasets with 
resampling methods more sophisticated than simple nearest neighbour, without 
an intermediate file that would have been produced by pct2rgb for example.

For example :
gdal_translate -of VRT -expand rgb color_indexed.tif color_expanded.vrt
gdalwarp -t_srs EPSG:32631 color_expanded.vrt color_expanded_warped.tif


More information about the gdal-dev mailing list