Selectively blur an image within a contrast threshold. It is similar to the unsharpen mask that sharpens everything with contrast above a certain threshold.
function selectiveBlurImage($image_path, $radius, $sigma, $threshold, $channel)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->selectiveBlurImage($radius, $sigma, $threshold, $channel);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}