I am working on adding ellipse cropping tool for my SGML capture system, but I am having some trouble with the transparent index color shifting position in the palette. When I first set the transparent color it always is in index 1, but after calling imagecopy() to layer the ellipse cropping area it get shifted in the palette. I figured allocating (1) color would make it shift to index (2), but it gets shifted to a random index and then set the transparent color to the orignal transparent color but to some index that is not in the palette anymore. Confused, so am I!
Say you have a image with 200 colors in a palette of 256 colors. The 200 colors are the only colors used. So before layering the transparent index is at index (1), after layering index (1) still holds the transparent color, but the transparent index has moved to index (222), which is not in the range of the active color palette.
So does anyone know how one can multi layer images, while not shifting the transparent index everytime you allocate a new color? I can do this fine with ImageMagick, but I am trying to keep development to just PHP, so users will not have to install other things just to support different shaping tools!
Here is example of the cropping tool so you can see what I trying to do...
http://www.ya-right.com/tools.php?t=0&s ... 632cfe5524
TIA
yj!
GD transparent index shifting
Moderators: onion2k, General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: