Imagick::adaptiveBlurImage


wizard apg

ADDS an adaptive blur filter to image.



<?php

bool 
public Imagick::adaptiveBlurImage(
                            
float $radius,
                            
float $sigma, 
                            
int $channel = Imagick::CHANNEL_DEFAULT
                                   
);

?>

$radius


This is a radius of the Gaussian in pixels, not counting the center pixel.

The value ZERO this value will be chosen automatically.



$sigma


The standard deviation of the Gaussian, in pixels.



$channel


Defaults to Imagick::CHANNEL_DEFAULT.





This function returns a TRUE on success.



AVAILABLE "imagick" CHANNEL
STUDIED IN THIS TUTORIAL

1810 - ImageMagick 7.1.2-34
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_ALPHA16 
imagick::CHANNEL_OPACITY16 
imagick::CHANNEL_MATTE  
imagick::CHANNEL_BLACK8 
imagick::CHANNEL_INDEX32 
imagick::CHANNEL_ALL134217727 
imagick::CHANNEL_DEFAULT134217727 
ed48

  1 EXERCISE   

<?php

// Run several times

$img1 = new Imagick();

$jpgfn = PATH2IMGW . '/jpg/all.jpg';
$str1img = 'img/resuls/allb501.jpg';

$img1->readImage($jpgfn);

$rd = mt_rand(0,10);
$sg = mt_rand(0,100);

$img1->adaptiveBlurImage($rd,$sg,imagick::CHANNEL_BLUE);

$strg = $img1->getImageBlob();

$img = imagecreatefromstring($strg);

imagejpeg($img, $str1img);

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

 RESULT   


adaptiveBlurImage(8,2,imagick::CHANNEL_YELLOW);

allb501.jpg

img/results/allb501.jpg apr