What seems simple is not: (
I am trying to add something like a watermark (transparent png) in the image (jpg). This is the code I'm using:
$width = 800; $height = 600; $bottom_image = imagecreatefromjpeg("portrait1.jpg"); $top_image = imagecreatefrompng("man2.png"); imagesavealpha($top_image, true); imagealphablending($top_image, true); imagecopy($bottom_image, $top_image, 200, 200, 0, 0, $width, $height); header('Content-type: image/png'); imagepng($bottom_image);
When I combine the images, the png is located in the right place, each one above and to the left of it is good (jpg is copied), but everything else is black.
I tried setting imagesavealpha and imagealphablending to false, there was no difference.
You can see the resulting image at http://ekstrakt.selfip.com/photobomb/image.php
I searched on the net, I can not find a solution.
Any help is appreciated.
source share