Imagick::trimImage
← transverseImage
uniqueImageColors →
Remove edges that are the background color from the image.
This method is available if Imagick has been compiled against ImageMagick version 6.2.9 or newer.
Two things should be noted from the above. First is like "-crop", "-trim" will retain the canvas size of the image. This means that the numerical arguments of the trim can be extracted, to allow for further processing, or adjustment of the of the image processing (see Trimming "Noisy" Images for an example of doing this).