[Gdal-dev] Mass Color Table conversion

Luca Casagrande luca.casagrande at gmail.com
Mon Oct 22 13:14:33 EDT 2007


Hello everybody!

I have got a lot of geoTIFF files that I am using as Tileindex inside
Mapserver.
I discovered that some of them have got the color table inverted and
this is confirmed by Gdalinfo:

One kind of raster:
[..]
 Color Table (RGB with 256 entries)
    0: 255,255,255,255
    1: 0,0,0,255
    2: 0,0,0,255
[..]

The other kind:
[..]
 Color Table (RGB with 256 entries)
    0: 0,0,0,255
    1: 255,255,255,255
    2: 0,0,0,255
[..]

The problem is that I need to assign transparency to white. I thought
about creating 2 different groups of images, and then assigning the
appropriate class, but i should check tiff one bye one :(
One solution could be to change the Color Table for all images and set
them to:
	0: 255,255,255,255
    	1: 0,0,0,255
	[..]

What do you think about this option? Is there a way for automating the
conversion?

Thanks

Luca

-- 
"Chiunque può simpatizzare col dolore di un amico, ma solo un animo nobile
riesce a simpatizzare col successo di un amico." Oscar Wilde

Home Page: http://www.ominiverdi.org
Socio GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it
Jabber: casagrande at jabber.linux.it




More information about the Gdal-dev mailing list