Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging two images with PHP

I'm trying to merge two images together with PHP.

For example... how would I go about placing image one on top of image two or merge, with basic PHP? I have tried something such as watermarking, but it doesn't seem to be working.

Image One

alt text

Image Two

alt text

...and have it turn into this? FINAL RESULT:

alt text

like image 232
homework Avatar asked Oct 06 '10 19:10

homework


1 Answers

I got it working from one I made.

<?php $dest = imagecreatefrompng('vinyl.png'); $src = imagecreatefromjpeg('cover2.jpg');  imagealphablending($dest, false); imagesavealpha($dest, true);  imagecopymerge($dest, $src, 10, 9, 0, 0, 181, 180, 100); //have to play with these numbers for it to work for you, etc.  header('Content-Type: image/png'); imagepng($dest);  imagedestroy($dest); imagedestroy($src); ?> 
like image 98
homework Avatar answered Sep 23 '22 07:09

homework