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:
- $type: This parameter is used to set the statistic type of image.
- $width: This parameter set the pixel width of image.
- $height: This parameter set the pixel height of image.
- $channel: This parameter is used to set the channel. The default value of channel is Imagick::CHANNEL_DEFAULT.
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:
- PHP | Imagick getImageColors() Function
- PHP | Imagick chopImage() Function
- PHP | Imagick vignetteImage() Function
Reference: http://php.net/manual/en/imagick.statisticimage.php
Recommended Posts:
- PHP | Imagick brightnessContrastImage() Function
- PHP | Imagick flipImage() Function
- PHP | Imagick getImageGamma() Function
- PHP | Imagick getImageColorspace() Function
- PHP | Imagick chopImage() Function
- PHP | Imagick shearImage() function
- PHP | Imagick getImageHeight() Function
- PHP | Imagick getImageWidth() Function
- PHP | Imagick charcoalImage() Function
- PHP | Imagick getImageColors() Function
- PHP | Imagick transverseImage() Function
- PHP | Imagick transposeImage() Function
- PHP | Imagick previewImages() Function
- PHP | Imagick labelImage() Function
- PHP | Imagick rotateImage() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



