开发者

GD Transparency PNG

开发者 https://www.devze.com 2023-01-16 04:58 出处:网络
So I basically have this: $img = imagecreatefrompng(\'assets/other/redcircle.png\'); imagepng($img); imagedestroy($img);

So I basically have this:

$img = imagecreatefrompng('assets/other/redcircle.png');
imagepng($img);
imagedestroy($img);

So the redcircle.png file has a transparency (with anti aliasing). Bu开发者_运维百科t GD just turns all the transparency in black? Is there a way to get back the original transparency?


You have to tell GD to save the alpha using imagesavealpha: http://www.php.net/manual/en/function.imagesavealpha.php

0

精彩评论

暂无评论...
验证码 换一张
取 消