Imagick::trimImage
(PECL imagick 2, PECL imagick 3)
Remove edges from the image
Description
Remove edges that are the background color from the image. 0x629
Parameters
fuzzBy default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. This parameter represents the variation on the quantum range.
Return Values
Success
Errors/Exceptions
Throws
Examples
Using Imagick::trimImage():
Trim an image, then display to the browser.
<?php
/* Create the object and read the image in */
$im = new Imagick("image.jpg");
/* Trim the image. */
$im->trimImage(0);
/* Output the image */
header("Content-Type: image/" . $im->getImageFormat());
echo $im;
?>