PHP | Imagick rotationalBlurImage() Function

The Imagick::rotationalBlurImage() function is an inbuilt function in PHP which is used to apply the blur over an image by a certain angle.

Syntax:

bool Imagick::rotationalBlurImage( $angle, $channel )

Parameters: This function accepts two parameters as mentioned above and described below:

  • $angle: This parameter is used to store the value of the angle.
  • $channel: This parameter provides the channel constant that is valid for channel mode. More then one channel can be combined using bitwise operator. The defaults channel in Imagick function is Imagick::CHANNEL_DEFAULT.

Return Value: This function returns True on success.

Below programs illustrate the Imagick::rotationalBlurImage() function in PHP:

Original Image:

Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php 
  
// Create new Imagick Object
$imagick = new Imagick(
  
// Use rotationalBlurImage function
$imagick->rotationalBlurImage(1);
$imagick->rotationalBlurImage(7);
$imagick->rotationalBlurImage(3);
  
// Set Image Header
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
?>

chevron_right


Output:

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php 
  
// require_once('path/vendor/autoload.php');
  
// Create new Imagick Object
$imagick = new Imagick('
https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-19.png');
  
// Use rotationalBlurImage function
$imagick->rotationalBlurImage(6, 4);
  
// Set header image
header("Content-Type: image/jpg");
  
echo $imagick->getImageBlob();
?>

chevron_right


Output:
rotationalImage1

Reference: http://php.net/manual/en/imagick.rotationalblurimage.php



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.