我面临一个奇怪的问题,当我使用php imagecopy imagemagik转换图像..这是我的代码
$cmd = "convert ".realpath($temp1)." -alpha set -channel alpha -background none -vignette 0x3 ".$dest_img;
exec($cmd);此代码使羽化边缘,所以我可以有一个干净的合并..这是我的代码合并图像
$image = imagecreatefromjpeg($postcard_img);
$frame = imagecreatefrompng($thumb_img);
list($w, $h) = getimagesize($postcard_img);
imagealphablending($frame,true);
//imagecopymerge($image, $frame, $coords[0], $coords[1], 0, 0, $w, $h, 100);
imagecopy($image, $frame, $coords[0], $coords[1], 0, 0, $w, $h);这就是结果
好吧,现在奇怪的东西..如果我不使用ImageMagik,并简单地通过将imagecopy()替换为imagecopymerge()来合并它,它会起作用,但会留下粗糙的边缘。下面是imagecopymerge()
$postcard_img = $postcard[0]["ms_filepath"].$postcard[0]["ms_filename"];
$thumb_img = $thumb[0]["ms_thumbpath"].$thumb[0]["ms_thumbname"];
$image = imagecreatefromjpeg($postcard_img);
$frame = imagecreatefrompng($thumb_img);
list($w, $h) = getimagesize($postcard_img);
imagealphablending($frame,true);
imagecopymerge($image, $frame, $coords[0], $coords[1], 0, 0, $w, $h, 100);这里是结果(查看粗糙的边缘)
我需要的是羽毛图像..任何想法为什么它的发生和如何克服它?