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

Imagick::selectiveBlurImage

PHP function Edit on GitHub ✎

(PECL imagick 3 >= 3.3.0)

Selectively blur an image within a contrast threshold

Description

Imagick::selectiveBlurImage(float $radius, float $sigma, float $threshold, int $channel = Imagick::CHANNEL_DEFAULT): bool

Selectively blur an image within a contrast threshold. It is similar to the unsharpen mask that sharpens everything with contrast above a certain threshold.

Parameters

radius
sigma
threshold
channel

Channel

Return Values

Success

Examples

Imagick::selectiveBlurImage()

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

?>

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