Open In App

PHP | Imagick medianFilterImage() Function

Last Updated : 27 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The Imagick::medianFilterImage() function is an inbuilt function in PHP which applies a digital filter that improves the quality of a noisy image. Syntax:
bool Imagick::medianFilterImage( float $radius )
Parameters: The function accepts a single parameter $radius which holds the radius of the pixel neighborhood. Return Value: This function returns TRUE on success. Errors/Exceptions: This function throws an ImagickException on error. Below program illustrates the Imagick::medianFilterImage() function in PHP: Program: php
<?php

// Create a new imagick object
$imagick = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/20190823154611/geeksforgeeks24.png');
 
// Applying the digital filter to the image
$imagick->medianFilterImage(10);
 
header("Content-Type: image/jpg");

// Display the output image
echo $imagick->getImageBlob();

?>
Output: Reference: https://www.php.net/manual/en/imagick.medianfilterimage.php

Next Article

Similar Reads