downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Imagick::uniqueImageColors> <Imagick::transverseImage
[edit] Last updated: Fri, 23 Mar 2012

view this page in

Imagick::trimImage

(PECL imagick 2.0.0)

Imagick::trimImageRemove edges from the image

Opis

bool Imagick::trimImage ( float $fuzz )

Remove edges that are the background color from the image. Ta metoda jest dostępna, jeśli rozszerzenie Imagick zostało skompilowane z ImageMagick w wersji 6.2.9 lub nowszej.

Parametry

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.

Zwracane wartości

Zwraca TRUE w przypadku sukcesu.

Błędy/Wyjątki

Zgłasza wyjątek ImagickException w przypadku błędu.

Przykłady

Przykład #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;
?>

Zobacz też:



add a note add a note User Contributed Notes Imagick::trimImage
dhp 22-Apr-2009 10:31
After operations that change the crop of the image, like trimImage does, IM preserves the old canvas and positioning info. If you need to do additional operations on the image based on the new size, you'll need to reset this info with setImagePage. This is the equivalent of the +repage command line argument.

<?php
$im
->trimImage(0);
$im->setImagePage(0, 0, 0, 0);
?>
Mark van der Velden 05-Dec-2007 06:35
This method requires ImageMagick version >= 6.2.8

 
show source | credits | stats | sitemap | contact | advertising | mirror sites