PHP Imagick rotateImage () function

PHP

Syntax:
bool Imagick::rotateImage ($background, $degrees) 
Parameters:this function takes two parameters as above and described below:
  • $background:this parameter is used to set the background color of the image. The datatype of this can be either string or float.
  • $degree:this parameter is used to set the rotation angle of the image. The rotation angle is interpreted as clockwise.
Returned value:This function returns True on success.The program below illustrates function Imagick::rotateImage()in PHP:
Original image:
Program :  
// require_once (' path / vendor / autoload.php '); 
// Create a new imagick object $image = new Imagick ( ' https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-12.png ' );  
// Function to rotate the image $image -> rotateimage ( 'green' , 25); header ( " Content-Type: image / jpg " );  
// Show output echo $image -> getImageBlob(); ?>
Output: Related Articles:
  • PHP | Imagick borderImage() function
  • PHP | Imagick annotateImage() function
Link: http://php.net/manual/en/imagick.rotateimage.php



Get Solution for free from DataCamp guru