[gdal-dev] translating palettes in geotiff

Even Rouault even.rouault at mines-paris.org
Tue Apr 23 13:11:20 PDT 2013


Le mardi 23 avril 2013 21:52:39, David Strip a écrit :
> I have a paletted geotiff that I want to modify by mapping palette
> entries to a new palette.
> Thus, I have an input palette, an output palette, and a geotiff.  I have
> a mapping (many to 1, if it matters) from the input palette to the
> output palette. Each pixel in the output geotiff will have a value
> equivalent to mapping the input geotiff's pixel value through the map.
> 
> I've looked over the utilities and none seems to have this capability.
> It would be pretty easy, I think to write code using gdal to do this,
> but if one of the utilities will handle this case, that's even better.
> 

One possibility would be to use a VRT file where you specify a <LUT> element to 
map the indices from the input palette to the indices of the output palette. 
See http://www.gdal.org/gdal_vrttut.html for the syntax.

> Thanks.
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list