You need to pass this function a colour:
<?php
$img->blackThresholdImage( "#FFFFFF" );
?>
E.g. this blackens any pixel which isn't pure white.(PECL imagick 2, PECL imagick 3)
Imagick::blackThresholdImage — Eşiğin altında kalan tüm renkleri siyaha çevirir
Bu işlev hala belgelendirilmemiştir; sadece bağımsız değişken listesi mevcuttur.
Eşiğin altında kalan tüm renkleri siyaha çevirmesi üstündekilere dokunmaması dışında Imagick::thresholdImage() gibidir.
eşikBu eşiğin altındaki herşey siyah olur.
   Başarı durumunda true döner.
  
| Sürüm: | Açıklama | 
|---|---|
| PECL imagick 2.1.0 | Artık renk olarak rengi ifade eden bir dizge belirtilebiliyor. Evvelce sadece bir ImagickPixel nesnesi belirtilebiliyordu. | 
Örnek 1 - Imagick::blackThresholdImage()
<?php
function blackThresholdImage($imagePath, $thresholdColor) {
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->blackthresholdimage($thresholdColor);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}
?>You need to pass this function a colour:
<?php
$img->blackThresholdImage( "#FFFFFF" );
?>
E.g. this blackens any pixel which isn't pure white.Here's a example of this function:
<?php
  $img = new Imagick();
  $img->readImage($image_file_name);
  $img->blackThresholdImage('grey');
  $img->writeImage($thumb_file_name);
  $img->clear();
  $img->destroy();
?>