Hallo,
ich wollte mal fragen, wie ich mit php ein transparentes bild (png) auf ein anderes kopieren kann ...
Leider wird das Bild ag.png mit einem weißen hintergrund draufkopiert ...
Was amche ich falsch?
ich wollte mal fragen, wie ich mit php ein transparentes bild (png) auf ein anderes kopieren kann ...
PHP-Code:
header('Content-Type: image/jpeg', true);
$img = imagecreatetruecolor($IMG_WIDTH, $IMG_HEIGHT);
$col = imagecolorallocate($img, 255, 255, 255);
imagefill($img, 0, 0, $col);
$src = imagecreatefromjpeg('bild.jpg');
imagecopymerge($img, $src, 0, 0, 0, 0, 500, 332, 100);
$src = imagecreatefrompng('ag.png');
imagecopymerge($img, $src, 10, 0, 0, 0, 16, 26, 100);
imagejpeg($img);
imagedestroy($img);
Leider wird das Bild ag.png mit einem weißen hintergrund draufkopiert ...
Was amche ich falsch?
Kommentar