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