HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Imagick::whiteThresholdImage

← whiteBalanceImage  
Is like Imagick::ThresholdImage() but force all pixels above the threshold into white while leaving all pixels below the threshold unchanged.

Example

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