How do i merge morethan 2 pics?

Hello!

that’s what code i’m using for this:

<?php
$image_1 = imagecreatefrompng('1.png');
$image_2 = imagecreatefrompng('2.png');
imagealphablending($image_1, true);
imagesavealpha($image_1, true);
imagecopy($image_1, $image_2, 0, 0, 250, 250, 350, 350);

header('Content-Type: image/png');
imagepng($image_1);
?>

http://cranterns.epizy.com/resource/images/testpic.php

i can merge two pics but how i merge more pics? i need to merge 13 pics.

Thank you :slight_smile:

i did it myself

<?php
$image_1 = imagecreatefrompng('1.png');
$image_2 = imagecreatefrompng('2.png');
$image_3 = imagecreatefrompng('3.png');
imagealphablending($image_1, true);
imagesavealpha($image_1, true);
imagecopy($image_1, $image_2, 0, 0, 250, 250, 350, 350);
imagecopy($image_1, $image_3, 0, 0, 250, 250, 350, 350);

header('Content-Type: image/png');
imagepng($image_1);
?>

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.