0
我是初学者,面临以下问题。我需要将两个imagefiles与imagemagick api合并 - >所以我使用php而不是comandline。如何合并imagemagick中的两个图像(php api)
我会非常感谢,如果有人能帮我解决这个问题。我以数字方式尝试过,但没有任何成功。
我是初学者,面临以下问题。我需要将两个imagefiles与imagemagick api合并 - >所以我使用php而不是comandline。如何合并imagemagick中的两个图像(php api)
我会非常感谢,如果有人能帮我解决这个问题。我以数字方式尝试过,但没有任何成功。
看看这个:http://phpimagick.com/Imagick/mergeImageLayers
我觉得这样的事情应该工作
function mergeImages()
{
// you should find the correct layerMethodType by yourself,
// here the available ones: http://php.net/manual/en/imagick.constants.php
$layerMethodType = imagick::LAYERMETHOD_COMPARECLEAR;
$img1 = new \Imagick(realpath("bg.png"));
$img2 = new \Imagick(realpath("play.png"));
$img1->addImage($img2);
$img1->setImageFormat('png');
$result = $img1->mergeImageLayers($layerMethodType);
header("Content-Type: image/png");
echo $result->getImageBlob();
}
THX我试过媒体链接这一个。没有输出/图像也没有错误。正如我想这个代码添加到我身边,我应该看到一个结果? – Jakob
得到它现在工作thx – Jakob