Is like Imagick::thresholdImage() but forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged.
Touch/mouse over to see original View modified in new window.
Image
Threshold color
 
Is like Imagick::thresholdImage() but forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged.
Parameters
thresholdmixedThe threshold below which everything turns black
function blackThresholdImage($imagePath, $thresholdColor)
{
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->blackthresholdimage($thresholdColor);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}