Imagick::addNoiseImage
PHP function
Edit on GitHub ✎
(PECL imagick 2, PECL imagick 3)
Adds random noise to the image
Description
Imagick::addNoiseImage(int $noise_type, int $channel = Imagick::CHANNEL_DEFAULT): bool
Adds random noise to the image.
Parameters
noise_typeThe type of the noise. Refer to this list of noise constants.
channelChannel
Return Values
Success
Examples
php
<?php
function addNoiseImage($noiseType, $imagePath, $channel) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->addNoiseImage($noiseType, $channel);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>