PHP | Imagick medianFilterImage() Function

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// Create a new imagick object
$imagick = new Imagick(
   
// Applying the digital filter to the image
$imagick->medianFilterImage(10);
   
header("Content-Type: image/jpg");
  
// Display the output image
echo $imagick->getImageBlob();
  
?>

chevron_right


Output:

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



My Personal Notes arrow_drop_up

I love Open Source Culture have contributed to phpMyAdmin, LibreOffice, Ant-Design and Web is my passion

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.