Open In App

PHP | Imagick medianFilterImage() Function

Improve
Improve
Like Article
Like
Save
Share
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
  
// 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();
  
?>


Output:

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


Last Updated : 27 Aug, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads