Palletizing Bulk Tiled Imagery

Frank Warmerdam warmerdam at POBOX.COM
Wed Mar 22 13:13:26 EST 2006


Dustin Moore wrote:
> Is there a procedure involving FOSS tools like GDAL or ImageMagick that
> can take a collection of tiled 24 bit GeoTIFFs, come up with an average
> best fit pallette, and then dither the TIFFs using that pallette? I see
> that there is a program called rgb2pct.py in GDAL but that doesn't allow 
> one
> to specify a universal palette.

Dustin,

The rgb2pct.py script was done as a script, partly so folks could tailor
it to their needs.  If you look at it you will see it has two sections.
One to compute the color table, and another to apply it.  I would suggest
you build some sort of mosaic, or montage of imagery that you consider
representative of your total set, and use the ComputeMedianCutPCT()
on that.  Then loop over all the images using the DitherRGB2PCT().

> Lastly, is there a FOSS tool that can take a collection of tiled TIFFs
> in one projection and then reproject/retile the TIFFs in another 
> projection?
> I've worked with gdalwarp on a per-tile basis but that makes the output
> tiles parallogrammed as per the re-projection and this causes me trouble 
> when
> I go to seamlessly composite the new tiles back together. 

I am not aware of such a tool.  Generally when I am in this situation
I warp to a bit mosaic and then cut that back up again if I require
things in tiles.

 > (Actually, the
> problem
> is with gdaladdo and how it interpolates NODATA elements into the 
> overviews but
> I'd rather just get the tiles square and not have any NODATA/edge 
> problems possible.)

This might be a good topic for a bug report.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org



More information about the mapserver-users mailing list