DJ Mike's Tutorials: PHP

Imagick Functions

^

Imagick::gaussianBlurImage

Description:
bool Imagick::gaussianBlurImage ( float $radius , float $sigma [, int $channel ] )

Blurs an image. Convolves the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and selects a suitable radius for you.
Parameters:
radius
The radius of the Gaussian, in pixels, not counting the center pixel.
sigma
The standard deviation of the Gaussian, in pixels.
channel
Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channeltype constants using bitwise operators. Defaults to Imagick::CHANNEL_ALL.
Channel constants:
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
Return Values
Returns TRUE on success.
Errors/Exceptions
Throws ImagickException on error.

Example


<?php 
$image 
= new imagick"opossum.jpg" ); 
$image->setimagebackgroundcolor("#fad888");
$image->gaussianBlurImage5); 
header"Content-Type: image/jpeg" ); 
echo 
$image;
?>



<?php 
$image 
= new imagick"opossum.jpg" ); 
$image->gaussianBlurImage1010imagick::CHANNEL_RED ); 
header"Content-Type: image/jpeg" ); 
echo 
$image;
?>


^


Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>