php gd using .gif palette on png image
Posted: Wed Nov 04, 2009 2:50 am
http://wutwilluchoose.info/xbox/copy2.php
Their both in png format.
but for some reason the watermarked image is using a gif palette.
Heres the code that im curently using
Their both in png format.
but for some reason the watermarked image is using a gif palette.
Heres the code that im curently using
Code: Select all
<?php
header('content-type: image/png');
$watermark = imagecreatefrompng("http://avatar.xboxlive.com/avatar/I%20patawic%20I/avatar-body.png");
imagesavealpha($watermark, false);
imagealphablending($watermark, false);
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
$image = imagecreatetruecolor($watermark_width, $watermark_height);
$image = imagecreatefrompng("base.png");
$size = getimagesize("base.png");
$dest_x = $size[0] - $watermark_width - 0;
$dest_y = $size[1] - $watermark_height - 0;
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, -120, $watermark_width, $watermark_height, 100);
imagepng($image);
imagedestroy($image);
imagedestroy($watermark);
?>