Imagick::quantizeImage
(PECL imagick 2.0.0)
Imagick::quantizeImage — Analyse les couleurs dans une référence d'image
Description
bool Imagick::quantizeImage
( int
$numberColors
, int $colorspace
, int $treedepth
, bool $dither
, bool $measureError
)Liste de paramètres
-
numberColors -
-
colorspace -
-
treedepth -
-
dither -
-
measureError -
Valeurs de retour
Returns TRUE on success.
Erreurs / Exceptions
Lance une exception ImagickException si une erreur survient.
Exemples
Exemple #1 Exemple avec Imagick::quantizeImage()
<?php
function quantizeImage($imagePath, $numberColors, $colorSpace, $treeDepth, $dither) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->quantizeImage($numberColors, $colorSpace, $treeDepth, $dither, false);
$imagick->setImageFormat('png');
header("Content-Type: image/png");
echo $imagick->getImageBlob();
}
?>