+

PHP Imagick reduNoiseImage () function

Syntax:
bool Imagick::reduceNoiseImage ($radius)
Parameters: This function takes one parameter, $radius, which is used to store the radius value.Return Value:This function returns True on success. Original image:
The program below illustrates Imagick::reduNoiseImage() functionin PHP:
Program 1:  
// Create a new Imagick object $imagick = new Imagick ( ` https:// media.engineerforengineer.org/wp-content/uploads/engineerforengineer-19.png ` );  
// Use a function to reduce noise $imagick -> reduceNoiseImage (3); header ( " Content-Type: image / jpg " );  
// Show image echo $imagick -> getImageBlob(); ?>
Output: Program 2: $string = "Computer Science portal for Geeks!" ;  
// Create a new image of the above line // and add color and background $im = new Imagick(); $draw = new ImagickDraw();  
// Fill the color in the image $draw -> setFillColor ( new ImagickPixel ( `green` ));  
// Set the text font size $draw -> setFontSize (50); $metrix = $im -> queryFontMetrics ( $draw , $string ); $draw -> annotation (0, 40, $string ); $im -> newImage ( $metrix [ `textWidth` ], $metrix [ `textHeight` ], new ImagickPixel ( `white` ));  
// Draw image $im -> drawImage ( $draw );  
// Reduce noise $im -> reduceNoiseImage (6); $im -> setImageFormat ( ` jpeg` ); header ( " Content-Type: image / jpg " );  
// Display the output image echo $im -> getImageBlob(); ?>
Output: Link : http://php.net/manual/en/imagick.reducenoiseimage.php
Get Solution for free from DataCamp guru