Imagick::trimImage

(PECL imagick 2, PECL imagick 3)

Imagick::trimImageRemove edges from the image

Descrição

publicImagick::trimImage(float$fuzz): bool

Remove edges that are the background color from the image. Este método estará disponível se a extensão Imagick tiver sido compilada com a ImageMagick versão 6.2.9 ou superior.

Parâmetros

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.

Valor Retornado

Retorna true em caso de sucesso.

Erros/Exceções

Lança uma exceção ImagickException em caso de erro.

Exemplos

Exemplo #1 Using Imagick::trimImage():

Trim an image, then display to the browser.

<?php

$im = new Imagick("image.jpg");


$im->trimImage(0);


header("Content-Type: image/" . $im->getImageFormat());
echo
$im;
?>

Veja Também

To Top