Imagick::posterizeImage

(PECL imagick 2.0.0)

Imagick::posterizeImageReduces the image to a limited number of color level

Descrizione

bool Imagick::posterizeImage ( int $levels , bool $dither )

Reduces the image to a limited number of color level.

Elenco dei parametri

levels

dither

Valori restituiti

Restituisce TRUE in caso di successo.

add a note add a note

User Contributed Notes 1 note

up
1
linspb at gmail dot com
4 months ago
At PHP 7.x before

$im->posterizeimage(2, FALSE);

do

$im->setImageType(imagick::IMGTYPE_COLORSEPARATION);

on PHP 5.x working without setImageType well.

Example:
$im = new Imagick();
$r = $im->readImageBlob($label);
if (!$r) {
    return FALSE;
}
$im->setImageType(imagick::IMGTYPE_COLORSEPARATION);
$im->posterizeimage(2, 0);
$bmp = $im->getImageBlob();
To Top