Open In App

PHP | Imagick rotationalBlurImage() Function

The Imagick::rotationalBlurImage() function is an inbuilt function in PHP that 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:

Return Value: This function returns True on success. Below programs illustrate the Imagick::rotationalBlurImage() function in PHP: 



Original Image: 

Program 1: 




<?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();
?>

Output: 

Program 2: 




<?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();
?>

Output: 

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


Article Tags :