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