I am trying to do a watermark mark with the php code, and everything seems to work fine, until I put a transparent PNG file to a GIF. This what happens:
So instead of transparent black watermark, I get this semi solid green thing on the top.
The watermark is
I use the following php code:
... $image = imagecreatefromgif($filepath);; $watermark_image = imagecreatefrompng($wm_filepath); imagealphablending($watermark_image, false); imagesavealpha($watermark_image, true); imagegif($image, $filepath); imagedestroy($image); imagecopy($image, $watermark_image, $offset['x'], $offset['y'], 0, 0, imagesx($watermark_image), imagesy($watermark_image) );
p.s. I have to mention that I tried to combine different settings using
and got no result
Now I am saving image as a png file. I deleted these two rows
imagealphablending($watermark_image, false); imagesavealpha($watermark_image, true); and it worked. However, the transparency of PNG is overlapping GIF.
imagealphablending($image, true); didn’t help. What shall I do?