Jump to content

How to set multiple transparent colors using imagecolorallocate()


Remix919

Recommended Posts

Hi there, I'm trying to make a watermark using a JPG background file and a JPG logo file. Now, I want certain colors of the logo to be transparent, namely shades of green. Anyone know how to do this? Here is my code I am using:

$green = imagecolorallocate($jpgimage, 0, 255, 1);

imagecolortransparent($jpgimage, $green);

 

imagecopymerge($img, $jpgimage, 100, 200, 0, 0, 640, 480, 100);

 

And that code works fine, but it only makes the $green RGB transparent, how can I make more than just that one RGB transparent? I would ideally want to make all shades of green to appear transparent.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.