Here's a example of this function:
<?php
  $img = new Imagick();
  $img->readImage($image_file_name);
  $img->whiteThresholdImage('grey');
  $img->writeImage($thumb_file_name);
  $img->clear();
  $img->destroy();
?>(PECL imagick 2, PECL imagick 3)
Imagick::whiteThresholdImage — Force tous les pixels en dessous du seuil en blanc
Identique à Imagick::ThresholdImage() mais force tous les pixels en dessous du seuil en blanc, laissant tous les autres pixels inchangés.
threshold
   Retourne true en cas de succès.
  
| Version | Description | 
|---|---|
| PECL imagick 2.1.0 | Autorise désormais une chaîne représentant la couleur comme paramètre. Les anciennes versions ne permettaient qu'un objet ImagickPixel. | 
Exemple #1 Exemple avec Imagick::whiteThresholdImage()
<?php
function whiteThresholdImage($imagePath, $color) {
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->whiteThresholdImage($color);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}
?>Here's a example of this function:
<?php
  $img = new Imagick();
  $img->readImage($image_file_name);
  $img->whiteThresholdImage('grey');
  $img->writeImage($thumb_file_name);
  $img->clear();
  $img->destroy();
?>