PHP 8.3.4 Released!

Imagick::quantizeImage

(PECL imagick 2, PECL imagick 3)

Imagick::quantizeImageAnalyse les couleurs dans une référence d'image

Description

public Imagick::quantizeImage(
    int $numberColors,
    int $colorspace,
    int $treedepth,
    bool $dither,
    bool $measureError
): bool

Liste de paramètres

numberColors

colorspace

treedepth

dither

measureError

Valeurs de retour

Retourne true en cas de succès.

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();
}

?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top