Note sure what i am doing wrong here… but im trying to merge 3 pngs over into one and it is throwing an error
Warning: imagepng() [function.imagepng]: gd-png error: no colors in palette in C:\wamp\www\jeep\public\test\png_2.php on line 22
$x = 300;
$y = 300;
$final_img = imagecreate($x,$y) or die("Failed in call to
imagecreate()
\n");
$image_1 = imagecreatefrompng('ae.png');
$image_2 = imagecreatefrompng('ad.png');
$image_3 = imagecreatefrompng('ao.png');
imagecopy($image_1, $final_img, 0, 0, 0, 0, $x, $y);
imagecopy($image_2, $final_img, 0, 0, 0, 0, $x, $y);
imagecopy($image_3, $final_img, 0, 0, 0, 0, $x, $y);
imagealphablending($final_img, false);
imagesavealpha($final_img, true);
imagepng($final_img, 'final_img.png');
You have the first two arguments to
imagecopyreversed. The order is destination, source. Correcting this may solve the error.http://php.net/imagecopy