[Gdal-dev] Transparent PNG with color table (palette)

Ludwig M Brinckmann ludwigbrinckmann at gmail.com
Mon May 28 06:45:55 EDT 2007


I need to create paletted PNG files with transparency.

I understand that I need to pass in a colour table with the alpha channel
set to 0.

As I cannot create PNGs directly, I first create a Tiff with the colourtable
and then do a CreateCopy.

But when I then look at the PNG colour table, the transparency values are
gone (all set to 255). This is also true for the intermediate Tiff file --
which is understandable as single band tiffs don't do transparency. I think
when creating the tiff the colourtable is adjusted so that it works for the
Tiff, but then my transparencies are lost. (If someone thinks this is a bug,
I will turn my code into a short example).

I tried to alter the colour table after creating the tiff (or the createCopy
of the PNG), but this is not supported.

What's the best way to do this -- maybe I just need a better intermediate
format that does transparencies and can be created (which one?)

Any hints?

Regards

Ludwig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070528/ae0fb059/attachment.html


More information about the Gdal-dev mailing list