tags:

views:

18

answers:

0

So this creates the expected results, except that my image has multiple transparency levels (beyond opaque and invisible) for anti aliasing. Once I merge the two images, all the anti aliasing goes away. Does anyone know of a fix for this?

$width = 220;
$height = 220;
$sourcex = 150;
$sourcey = 250;
$dest = imagecreatetruecolor($width, $height);
$im = imagecreatefrompng('image.png');
imagesavealpha($im, true);
imagealphablending($im, true);
imagecolortransparent($dest, imagecolorat($dest, 1, 1));
imagecopy($dest, $im, 0, 0, $sourcex, $sourcey, $width, $height);
imagepng($dest);
imagedestroy($dest);