Is like Imagick::ThresholdImage() but force all pixels above the threshold into white while leaving all pixels below the threshold unchanged.
function whiteThresholdImage($image_path, $threshold_color)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->whiteThresholdImage($threshold_color);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}