Open In App

PHP | Imagick statisticImage() Function

The Imagick::statisticImage() function is an inbuilt function in PHP which is used to replace each pixel with corresponding statistic from the neighborhood of the specified width and height.

Syntax:



bool Imagick::statisticImage( $type, $width, $height, $channel )

Parameters: This function accepts four parameter as mentioned above and described below:

Return Value: This function returns True on success.



Below program illustrates the Imagick::statisticImage() function in PHP:

Program:




<?php
  
// Create an Imagick object
$imagick = new Imagick(
  
// Use statisticImage function
$imagick->statisticImage(10, 5,    5);
  
header("Content-Type: image/jpg");
      
// Display the output image
echo $imagick->getImageBlob();
?>

Output:

Related Articles:

Reference: http://php.net/manual/en/imagick.statisticimage.php

Article Tags :