HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Black threshold image

← bilateralBlurImage   blueShiftImage →
Is like Imagick::thresholdImage() but forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged.

Example

function blackThresholdImage($image_path, $thresholdColor)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->blackthresholdimage($thresholdColor);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}