feesar
feesar

Reputation: 500

Merge 2 images into 1, with blur

How can I merge 2 images in PHP and have a blur effect?

I need to make something like this http://www.bildites.lv/images/yzgc1puaci0nk1qeo0v.jpg (this image was created using photoshop).

Upvotes: 1

Views: 217

Answers (1)

Jenson M John
Jenson M John

Reputation: 5689

You can use imagecopymerge() function.

For eg.

    <?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);
    ?>

Upvotes: 1

Related Questions