Open In App

PHP | Imagick swirlImage() Function

Last Updated : 27 Sep, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The Imagick::swirlImage() function is an inbuilt function in PHP which is used to swirl the pixels about the center of the image. The degree indicates the sweep of the arc to move each pixel.

Syntax:

bool Imagick::swirlImage( float $degrees )

Parameters: This function accepts single parameter $degrees which defines the tightness of the swirling effect.

Return Value: This function returns TRUE on success.

Exceptions: This function throws ImagickException on error.

Below program illustrates the Imagick::swirlImage() function in PHP:

Program:




<?php 
    
// Create a Imagick object 
$imagick = new Imagick(
    
// Swirl the image
$imagick->swirlImage(350); 
  
header('Content-type: image/png'); 
    
// Display the output image 
echo $imagick
  
?> 


Output:

Reference: https://www.php.net/manual/en/imagick.swirlimage.php 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads