(PECL imagick 2.0.0)
Imagick::trimImage — Remove edges from the image
$fuzz
) : boolRemove edges that are the background color from the image. 锟剿凤拷锟斤拷锟斤拷Imagick锟斤拷锟斤拷ImageMagick 6.2.9锟斤拷锟较版本锟斤拷锟斤拷时锟斤拷锟矫★拷
fuzz
By 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.
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷
锟斤拷锟斤拷时锟阶筹拷 ImagickException锟斤拷
Example #1 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);
/* Ouput the image */
header("Content-Type: image/" . $im->getImageFormat());
echo $im;
?>