PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Nov 13, 2018 12:47 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Feb 19, 2006 2:06 pm 
Offline
Forum Commoner

Joined: Sat Oct 29, 2005 9:16 pm
Posts: 98
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!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 19, 2006 4:26 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 23, 2003 3:10 am
Posts: 11470
Location: Toronto
Moved to PHP-GD.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 19, 2006 6:34 pm 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com
As far as I know there's no way to control the exact palette position of any particular color unless you rewrite the palette by hand or copy it from another image.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 10:39 am 
Offline
Forum Newbie

Joined: Wed Mar 15, 2006 10:23 am
Posts: 5
Can you provide a small script to reproduce what you want to do? The elliptical selection does not really matter. Also be sure to use the bundled gd as Jcart noticed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group