Re: [GD-DEVEL] Newbie transparent gif question- possibly solved.
[email protected] ("Pierre Joye") Tue, 6 May 2008 17:40:29 +0200
| Newsgroups | php.gd.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, May 6, 2008 at 5:29 PM, Roger Oberholtzer <[email protected]> wrote: > So you agree. Granted, the coding here is perhaps not what should be > done. But it does demonstrate a red image with red set to be the > transparent color - that will not have a transparent background. This > code is obviously incorrect in execution, if not in intention. Either I'm getting bad at explaining things or you focus way too much on the RGB values instead of the main ideas behind palette images: Indexed colors :) > > > Read in a file that already contains red and has that as the background > > > color, and do this: > > > > > > # read file > > > red = gdImageColorAllocate(im, 255,0,0); > > > gdImageColorTransparent(im, red); > > > # save file > > > > > > The background will no longer be transparent. Even it it was when you > > > read the file. > > > > Please provide a file showing this case. > > I will re-break my program and provide you with one. This is more what I > was doing at the beginning of all my problems. I would make a new image > and define a transparent color as the first color, and save it to a > file. I would then read in the file and once again define (Allocate) the > same RGB values as a color and make it the transparent color - just as I > had done when I first made the image. At which time, my transparency > vanished. Again (sigh), RGB values in palette images are completely irrelevant, GD uses the indexes. But yes, a sample code will help me to help you :) Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org