The Imagick::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:
bool Imagick::addNoiseImage ( $noise_type, $channel )
Parameters: This function accepts two parameters as mentioned above and described below:
- $noise_type: This parameter is used to set the noise types. There are some noise constants available in Imagick function which are listed below:
- imagick::NOISE_UNIFORM
- imagick::NOISE_GAUSSIAN
- imagick::NOISE_MULTIPLICATIVEGAUSSIAN
- imagick::NOISE_IMPULSE
- imagick::NOISE_LAPLACIAN
- imagick::NOISE_POISSON
- imagick::NOISE_RANDOM
This constant supports on ImageMagick version 6.3.6 and above.
- $channel: This parameter provides the channel constants. Two or more channel can be combined using bitwise operator. There are some channel constants available in Imagick function which are listed below:
- imagick::CHANNEL_UNDEFINED
- imagick::CHANNEL_RED
- imagick::CHANNEL_GRAY
- imagick::CHANNEL_CYAN
- imagick::CHANNEL_GREEN
- imagick::CHANNEL_MAGENTA
- imagick::CHANNEL_BLUE
- imagick::CHANNEL_YELLOW
- imagick::CHANNEL_ALPHA
- imagick::CHANNEL_OPACITY
- imagick::CHANNEL_MATTE
- imagick::CHANNEL_BLACK
- imagick::CHANNEL_INDEX
- imagick::CHANNEL_ALL
- imagick::CHANNEL_DEFAULT
Return Value: This function returns TRUE on success.
Below program illustrate the Imagick::addNoiseImage() function in PHP:
Original Image:

Program:
<?php // require_once('path/to/vendor/autoload.php'); header('Content-type: image/png'); $image = new Imagick( $image->addNoiseImage(3, imagick::CHANNEL_DEFAULT); echo $image; ?> |
Output:

Reference: http://php.net/manual/en/imagick.addnoiseimage.php
Recommended Posts:
- PHP | Gmagick addnoiseimage() Function
- PHP | Imagick affineTransformImage() Function
- PHP | Imagick cycleColormapImage( ) Function
- PHP | Imagick getPackageName() Function
- PHP | Imagick liquidRescaleImage() Function
- PHP | Imagick implodeImage() Function
- PHP | Imagick pingImage() Function
- PHP | Imagick getImageSignature() Function
- PHP | Imagick getImageTicksPerSecond() Function
- PHP | Imagick getInterlaceScheme() Function
- PHP | Imagick setImageRedPrimary() Function
- PHP | Imagick setImageGreenPrimary() Function
- PHP | Imagick pingImageBlob() Function
- PHP | Imagick paintTransparentImage() Function
- PHP | Imagick getVersion() Function
- PHP | Imagick transparentPaintImage() Function
- PHP | Imagick getImageDelay() Function
- PHP | Imagick getImageRedPrimary() Function
- PHP | Imagick setImageOpacity() Function
- PHP | Imagick setImageGravity() Function
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.

