1

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

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

4

1 回答 1

1

您可以使用 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);
    ?>
于 2013-09-25T12:34:33.037 回答