HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Imagick::statisticImage

← spreadImage   subImageMatch →
Replace each pixel with corresponding statistic from the neighborhood of the specified width and height.

Example

function statisticImage($image_path, $statisticType, $width, $height, $channel)
{
    $imagick = new \Imagick(realpath($image_path));

    $imagick->statisticImage(
        $statisticType,
        $width,
        $height,
        $channel
    );

    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}