[Gdal-dev] colortable: unwanted increase of colors

Frank Warmerdam warmerdam at pobox.com
Sat Dec 3 18:47:07 EST 2005


On 12/2/05, Chris <cb at delta-h.de> wrote:
> Hello!
>
> When I use gdal to copy an existing .tif file, which has two colors in
> it's colortable, the copy gets 256 colors, which has the nasty
> side-effect of larger files and slower performance (while displaying the
> file in my app).
>
> How can I save a copy with exactly the same colortable as my original file?
>
> Attached you find the method I use, stripped to the minimum.

Chris,

I suspect the problem is that the GDAL data model does not
support a "1bit" band type.  So 1 bit TIFF files are expanded
to 8bit during reading - and thus appear that way in the output
file.   I deliberately avoided supporting partial byte datatypes
in GDAL because of how much they complicate alot of data
manipulation.

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    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list