javascript - Superimpose Images with PHP -


i searching way overlay image on existing image.

e.g:

img1 + img2

i have found great example on here: png overlay using 1 single image element. have two problems these.

first of all, don't want dimensions equal each other. e.g (215*215 on 215*215). because users have ability choose want put image. (top, left, bottom, top-right) 8 directions.

the second problem in example, 2 images allowed overlay. users (again) have ability put multiple images on top of it.

i have little knowledge of javascript , php, great if guys (and girls) me out.

sincerely,

you can using gd library. there function "merge" images called imagecopymerge.

here simple example how merge images:

<?php header('content-type: image/jpeg');  $bg = imagecreatefromjpeg('background.jpg'); $img = imagecreatefromjpeg('image.jpg');  imagecopymerge($bg, $img, 0, 0, 0, 0, imagesx($bg), imagesy($bg), 75);  imagejpeg($bg, null, 100); ?> 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -