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

Imagick::spreadImage

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Randomly displaces each pixel in a block

Description

Imagick::spreadImage(float $radius): bool

Special effects method that randomly displaces each pixel in a block defined by the radius parameter.

Parameters

radius

Return Values

Success

Errors/Exceptions

Throws

Examples

Imagick::spreadImage()

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

?>

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