How i can join two images???

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
mikefried

How i can join two images???

Post by mikefried »

Hi at All,

I'm new to Imagick and my question is, How i can use two images in one new Image???

first I will create a new emty image with ImageWidth 1000 and ImageHeight 500. Then i will load image1.jpg with image1Width=500 and image1Heigth=500 and place this image on the left hand side. After this i will load image2.jpg (also 500x500) and place this on the right hand side.

How i can to this with Imagick????

Mike
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How i can join two images???

Post by fmw42 »

in command line you would use the -append or + append

see http://www.imagemagick.org/script/comma ... php#append
mikefried

Re: How i can join two images???

Post by mikefried »

Thank You,

for your quick answer, but i forgot to say, that i'm looking for a solution in PHP.

Now i try to use the example from http://php.net/manual/de/function.imagi ... images.php

Mike
mikefried

Re: How i can join two images???

Post by mikefried »

i can't load a image in my new Image??

Code: Select all

$image = new Imagick();
$image->newImage(1000,500, '#00000000'); 
$image->setImageFormat('png');

$input = new Imagick();
$input->readImage($input_path.'auto.jpg');
????????????????????????????
$image->appendImages($input);
?????????????????????????????????
$image->writeImage($output_path.'output_Bild2.png');
How i can place the loaded $input image in my new $image???

Mike
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: How i can join two images???

Post by mkoppanen »

compositeImage would be one way
Mikko Koppanen
My blog: http://valokuva.org
Post Reply