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

Imagick::oilPaintImage

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Simulates an oil painting

Description

Imagick::oilPaintImage(float $radius): bool

Applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius.

Parameters

radius

The radius of the circular neighborhood.

Return Values

Success

Examples

Imagick::oilPaintImage()

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

?>

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