我有几个png图像是这样生成的:
$img = imagecreatefrompng($full_path_to_file);
imagealphablending($img , true); // setting alpha blending on
imagesavealpha($img , true); // save alphablending setting图像显示得很好,颜色正确,背景透明。
我需要把这些图像组合成一个。为此,我做了以下工作:
$full_image = imagecreate($full_width, $full_height);imagecopy($full_image, $src, $dest_x, $dest_y, 0, 0, $src_width, $src_height)图像是组合的好的。背景是透明的,但是颜色不正确。
我怎样才能确保得到正确的颜色?
更新:按照的建议,修复也是使用imagecreatetruecolor,我需要将第二个参数设置为imagealphablending为false。因此,在创建png映像和创建full_image时,我调用
imagealphablending($img , false); // updated to FALSE
imagesavealpha($img , true); “意象”文档
你必须取消字母混合($im,false),才能使用它。
发布于 2013-08-23 20:03:52
尝试使用:图像--真彩色而不是图像。
https://stackoverflow.com/questions/18410739
复制相似问题