function rollImage($image_path, $rollX, $rollY) { $imagick = new \Imagick(realpath($image_path)); $imagick->rollimage($rollX, $rollY); header("Content-Type: image/jpeg"); echo $imagick->getImageBlob(); }