Akhil Sahu Akhil Sahu - 1 year ago 95
PHP Question

Merge two image created using php

How can i merge two image created from url two url like:

Merge these two images:



Not same as the possible duplicate: Image not fetched

Answer Source

To merge two images like shown here and assuming that images are in png .You might need to use following code:

$dest = imagecreatefrompng($url1);
$src = imagecreatefrompng($url2);
imagecopymerge($dest, $src, 0, 0, 0, 0, 500, 100, 90);

The following can be used to output image to browser

header('Content-Type: image/png');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download