Rubblewebs

THESE CODES ARE PROVIDED FOR AN EXAMPLE OF HOW TO USE IMAGEMAGICK WITH PHP. CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.

I TAKE NO RESPONSABILTY FOR ANY PROBLEMS THAT MAY OCCURE WHEN USING ANY OF THIS CODE.

IT IS UP TO YOU TO SECURE THE CODE AND VALIDATE USER INPUT.

Combine photos

Combine photos example
 
// Combine the two photos composite method
$cmd = " -gravity center shadow.png -resize 100x100 ".
" double_gradiant.jpg -quality 100 ";
exec("composite $cmd composite1.jpg");

//Composite is limited in what operators can be used and can only process two images.

// Combine the two photos convert method
$cmd = " shadow.png -resize 100x100 double_gradiant.jpg ".
" +swap -gravity center -composite -quality 100 ";
exec("convert $cmd composite1.jpg"); 

Notice the order of the images changes with convert. I have used +swap to change the order they are processed


Back