Open In App

PHP | Imagick blurImage() function

Last Updated : 26 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The Imagick::blurImage() function is an inbuilt function in PHP which is used to add blur filter to the image. This function returns True on success. Syntax:
bool Imagick::blurImage( $radius, $sigma, $channel )
Parameters: This function accepts three parameters as mentioned above and described below:
  • $radius: This parameter is used to set blur radius in an image.
  • $sigma: It sets the standard deviation.
  • $channel: This parameter set the channel type constant. If it is not supplied then all channels are blurred.
Return Value: This parameter returns True on success. Below programs illustrate the Imagick::blurImage() function in PHP: Program 1: php
<?php

// Create an Imagick object
$image = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png');

header('Content-type: image/jpeg');

// Use blurImage function
$image->blurImage(5, 3);

// Display the output image
echo $image;
?>
Output: blur image Program 2: php
<?php

// Create an Imagick object
$image = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/col1.png');

header('Content-type: image/jpeg');

// Use blurImage function
$image->blurImage(7, 3);

// Display the output image
echo $image;
?>
Output: blur image Related Articles: Reference: http://php.net/manual/en/imagick.blurimage.php

Next Article
Practice Tags :

Similar Reads