php8.5
Home/ Manual/ imagick / imagick/ Imagick::rollImage

Imagick::rollImage

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Offsets an image

Description

Imagick::rollImage(int $x, int $y): bool

Offsets an image as defined by x and y.

Parameters

x

The X offset.

y

The Y offset.

Return Values

Success

Examples

Imagick::rollImage()

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

?>

Source: reference/imagick/imagick/rollimage.xml · from the official PHP manual (php/doc-en)