-
Notifications
You must be signed in to change notification settings - Fork 274
Closed
Milestone
Description
imagecopyresampled() produce many artifacts on transparent PNG.
I added a yellow layer to the output image to make the artifacts easier to see.
In the test code below a small resolution (thumbnail) is used on the output image, but similar artifacts also appear in higher resolutions.
Everything worked well on previous GD version (2.0 I think), but after the upgrade on v 2.2.5, the artifacts began to appear.
I was looking for a solution on the internet, but I did not find anything functional, it is probably a bug in the function imagecopyresampled().
Test code:
$img_src = imagecreatefrompng('source.png');
$img_dest = imagecreatetruecolor(225, 225);
imagealphablending($img_dest, false);
imagesavealpha($img_dest, true);
imagecopyresampled($img_dest, $img_src, 0, 0, 0, 0, 225, 225, 2000, 2000);
imagepng($img_dest, 'imagecopyresampled1.png');
Metadata
Metadata
Assignees
Labels
No labels