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.

Layer options

TrimBounds

Find the bounds of all the images in the current image sequence.

More information to follow.

$cmd = " $input6 -layers TrimBounds +repage ";
exec("convert $cmd trimbounds.png");

( Find the bounds of all the images in the current image sequence, then adjust the offsets so all images are contained on a minimal positive canvas. None of the image data is modified, only there virtual canvas size and offset. The all the image is given the same canvas size, and and will have a positive offset, but will remain in the same position relative to each other. As a result of the minimal canvas size at least one image will touch every edge of that canvas. The image data however may be transparent. )