PHP | Gmagick addnoiseimage() Function Last Updated : 06 Nov, 2020 Comments Improve Suggest changes Like Article Like Report The Gmagick::addnoiseimage() function is an inbuilt function in PHP which is used to add noise in given image. The intensity of noise depends on noise constants and channel types. The image noise is the random variation of brightness and contrast in an image. Syntax: Gmagick Gmagick::addnoiseimage ( $noise_type ) Parameters: This function accepts a single parameter $noise_type which is used to set the noise types. Return Value: This function returns the Gmagick object with noise. Errors/Exceptions: This function throws GmagickException on error. Below programs illustrates the Gmagick::addnoiseimage() function in PHP: Original Image 1: Program 1: PHP <?php // Create a Gmagick object $gmagick = new Gmagick( 'https://media.geeksforgeeks.org/wp-content/uploads/tech.png'); // Add noise in image. $gmagick->addnoiseimage(2); header('Content-type: image/png'); // Output the image echo $gmagick; ?> Output: Program 2: PHP <?php // Create a GmagickDraw object $draw = new GmagickDraw(); // Create GmagickPixel object $strokeColor = new GmagickPixel('Red'); $fillColor = new GmagickPixel('Green'); // Set the color, opacity of image $draw->setStrokeOpacity(1); $draw->setStrokeColor('Red'); $draw->setFillColor('Green'); // Set the width and height of image $draw->setStrokeWidth(7); $draw->setFontSize(72); // Function to draw circle $draw->circle(250, 250, 100, 150); $gmagick = new Gmagick(); $gmagick->newImage(500, 500, 'White'); $gmagick->setImageFormat("png"); $gmagick->drawImage($draw); // Add noise in the image $gmagick->addnoiseimage(5); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Reference: http://php.net/manual/en/gmagick.addnoiseimage.php Comment More infoAdvertise with us Next Article PHP | Gmagick addnoiseimage() Function S sarthak_ishu11 Follow Improve Article Tags : Technical Scripter Web Technologies PHP Image-Processing PHP-function PHP-Gmagick +2 More Similar Reads PHP | Gmagick addImage() Function The Gmagick::addImage() function is an inbuilt function in PHP which is used to adds new image to Gmagick object image list. This function adds a new image to Gmagick object from the current position of the source object. The Gmagick class have the ability to hold and operate on multiple images simu 2 min read PHP | Imagick addImage() Function The Imagick::addImage() function is an inbuilt function in PHP which is used to adds new image to Imagick object image list. After the operation iterator position is moved at the end of the list. This function adds new image to Imagick object from the current position of the source object. The Imagi 1 min read PHP | Gmagick annotateImage() Function The Gmagick::annotateImage() function is an inbuilt function in PHP which is used to annotates an image with text. This function returns True on success. Syntax: Gmagick Gmagick::annotateimage( $GmagickDraw, $x, $y, $angle, $text ) Parameters: This function accepts five parameters as mentioned above 2 min read PHP | Gmagick edgeimage() Function The Gmagick::edgeimage() function is an inbuilt function in PHP which is used to enhance the image edges using convolution filter of the given radius. Radius 0 is used as auto-selected.Syntax:Â Â Gmagick Gmagick::edgeimage( $radius ) Parameters: This function accepts a single parameter as $radius whi 1 min read PHP | Gmagick enhanceimage() Function The Gmagick::enhanceimage() function is an inbuilt function in PHP which is used to improve the quality of a noisy image. This function applies the digital filter to improve quality.Syntax:Â Â Gmagick Gmagick::enhanceimage( void ) Parameters: This function does not accepts any parameter.Return Value: 1 min read Like