function selectiveBlurImage($image_path, $radius, $sigma, $threshold, $channel) { $imagick = new \Imagick(realpath($image_path)); $imagick->selectiveBlurImage( $radius, $sigma, $threshold * \Imagick::getQuantum(), $channel ); header("Content-Type: image/jpeg"); echo $imagick->getImageBlob(); }