Re: [GD-DEVEL] Newbie transparent gif question- possibly solved.

[email protected] (Roger Oberholtzer) Fri, 02 May 2008 14:31:51 +0200
Newsgroups php.gd.devel
Message-ID <[email protected]>
On Fri, 2008-05-02 at 14:29 +0200, Pierre Joye wrote:
> On Fri, May 2, 2008 at 2:25 PM, Roger Oberholtzer <[email protected]> wrote:
> 
> >  OK. But that is how it looks. If an image has the transparent color more
> >  than once in the color map,
> 
> It does not use the color value but the color index. An index is
> unique in the palette (from 0 to 255).
> 
> > and gdImageColorTransparent is called with
> >  anything other than the first in the color map, you do not get a
> >  transparent image. There may be more at play here, but it seems I can
> >  manipulate this in a predictable manner. The change to my application
> >  was minor, but I now seem to get transparent gifs as expected. I looked
> >  a the transparency test program in the source: it is for true color
> >  images. I did not see a transparency test program for colors as I am
> >  using them. Maybe it is not a program on it's own. I am happy to explore
> >  more as I would like to know that my code is correct and not hiding some
> >  stupid bug on my part.
> 
> I will create a small example code later today, it may help.

Thanks! Be sure to do one where you Allocate a color more than once, and
set the transparency to one after the first Allocate of the color.

-- 
Roger Oberholtzer

OPQ Systems / Ramböll RST

Ramböll Sverige AB
Kapellgränd 7
P.O. Box 4205
SE-102 65 Stockholm, Sweden

Office: Int +46 8-615 60 20
Mobile: Int +46 70-815 1696