Imagick::addNoiseImage


wizard apg

ADDS a randon noise to one image.



<?php

bool 
public Imagick::addNoiseImage(
                                
int $noise_type
                                
int $channel Imagick::CHANNEL_DEFAULT
                                       
);

?>

$noise


The type of the noise.

Refer to this list of noise constants.



$channel


Refer to this list of channel constants.

Defaults to Imagick::CHANNEL_DEFAULT.





This function returns a TRUE on success.



AVAILABLE "imagick" NOISE
STUDIED IN THIS TUTORIAL

1690 - ImageMagick 6.9.10-6
NOISE
CONSTANTVALUEABOUT
imagick::NOISE_UNIFORM1 
imagick::NOISE_GAUSSIAN2 
imagick::NOISE_MULTIPLICATIVEGAUSSIAN3 
imagick::NOISE_IMPULSE4 
imagick::NOISE_LAPLACIAN5 
imagick::NOISE_POISSON6 
imagick::NOISE_RANDOM7 ImageMagick version 6.3.6 or higher.
ed48

AVAILABLE "imagick" CHANNEL
STUDIED IN THIS TUTORIAL

1690 - ImageMagick 6.9.10-6
CHANNEL
CONSTANTVALUEABOUT
imagick::CHANNEL_UNDEFINED0 
imagick::CHANNEL_RED1 
imagick::CHANNEL_GRAY1 
imagick::CHANNEL_CYAN1 
imagick::CHANNEL_GREEN2 
imagick::CHANNEL_MAGENTA2 
imagick::CHANNEL_BLUE4 
imagick::CHANNEL_YELLOW4 
imagick::CHANNEL_ALPHA8 
imagick::CHANNEL_OPACITY8 
imagick::CHANNEL_MATTE 8  
imagick::CHANNEL_BLACK32 
imagick::CHANNEL_INDEX32 
imagick::CHANNEL_ALL134217727 
imagick::CHANNEL_DEFAULT134217719 
ed48

  1 EXERCISE   

<?php 

// Run this several times

$imagick = new Imagick(PATH2IMGW '/bmp/aa.bmp');

$str1img 'img/results/aa551.bmp';

$noise_type imagick::NOISE_RANDOM;

$channel imagick::CHANNEL_DEFAULT;

 
$imagick->addNoiseImage($noise_type$channel);
 
 
$Data $imagick->getImageBlob();
  
$img imagecreatefromstring($Data);

imagebmp($img$str1imgfalse);

echo 
basename($str1img); ?>
<br><br>
<img src="<?php echo $str1img?>"
 alt="<?php echo $str1img?>
 title="<?php echo $str1img?>">

 RESULT   


addNoiseImage(5,imagick::CHANNEL_ALL);

aa551.bmp


img/results/aa551.bmp apr