将 2 张图像合并为 1 张,模糊


Merge 2 images into 1, with blur

如何在 PHP 中合并 2 张图像并产生模糊效果?

我需要制作这样的东西 http://www.bildites.lv/images/yzgc1puaci0nk1qeo0v.jpg(此图像是使用 photoshop 创建的)。

你可以使用 imagecopymerge() 函数。

例如。

    <?php
    $dest = imagecreatefrompng('first.png');
    $src = imagecreatefromjpeg('second.jpg');
    imagealphablending($dest, false);
    imagesavealpha($dest, true);
    imagecopymerge($dest, $src, 11, 11, 0, 0, 100, 43, 73); //See function parameter details
    header('Content-Type: image/png');
    imagepng($dest);
    imagedestroy($dest);
    imagedestroy($src);
    ?>