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 — 閾値に満たないすべてのピクセルを白にする
Imagick::thresholdImage() と似ていますが、 これは閾値に満たないピクセルをすべて白にし、その他のピクセルはそのままにします。
threshold
   成功した場合に true を返します。
  
| バージョン | 説明 | 
|---|---|
| PECL imagick 2.1.0 | 色を表す文字列をパラメータとして指定できるようになりました。 これまでのバージョンでは ImagickPixel オブジェクトしか指定できませんでした。 | 
例1 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();
?>