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