Transparency Gd Library (Easy)

I have a red image with blue text and am trying to make the red  in the image transparent... it doesnt work.. Any ideas??
Thanks

  $image       = 'ImageManipulation/TemoraryImages/blue.gif';
    $image       = imagecreatefromgif($image);
    //Make transparent all red in the image
    $MakeTrans   = imageColorAllocate($image, 255,0,0);
    imagecolortransparent($image,$MakeTrans);
    imagegif($image);

boss234Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BogoJokerCommented:
I don't know much about images, I know some people here do though, so i'll just do my basic error checking =)
Are you sure the color that your trying to make transparent is exactly (255,0,0)?
Joe P
0
boss234Author Commented:
Yes, i just made it to test the code.
M
0
pallospCommented:
The problem is that you create a new red palette entry and make that transparent.
The original red pixels still remain red. You should find the palette index used for red pixels and make it transparent.
I'm now looking for the php function to read the palette.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

pallospCommented:
I've found it: the palette index of the red color can be retieved by the imagecolorexact function.

http://hu2.php.net/manual/en/function.imagecolorexact.php
0
boss234Author Commented:
Thanks pallosp - - i get a pallet index of ZERO (0) is this right?

Regards
0
pallospCommented:
If making the 0th element transparent solves your problem, definitely it is right.
-1 means that the given color doesn't exist, so 0 can be a right index.
You may check it by a photo editor that is able to display the palette of an image (such as Paint Shop Pro).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.