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

Imagick::compareImageLayers

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Returns the maximum bounding region between images

Description

Imagick::compareImageLayers(int $method): Imagick

Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers. 0x629

Parameters

method

One of the layer method constants.

Return Values

Success

Errors/Exceptions

Throws

Examples

Using Imagick::compareImageLayers()

Comparing image layers

php
<?php
/* create new imagick object */
$im = new Imagick("test.gif");

/* optimize the image layers */
$result = $im->compareImageLayers(imagick::LAYERMETHOD_COALESCE);

/* work on the $result */
?>

See Also

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