PHP | Imagick rotateImage() Function
The Imagick::rotateImage() function is an inbuilt function in PHP which is used to rotate an image by a given angle and the empty spaces filled with given color.
Syntax:
bool Imagick::rotateImage( $background, $degrees )
Parameters: This function accepts two parameters as mentioned above and described below:
- $background: This parameter is used to set the background color of image. Datatype of this can be string as well as float.
- $degrees: This parameter is used to set the angle by which the image is rotated. The rotation angle is interpreted as clockwise.
Return Value: This function returns True on success.
Original Image:

Program:
<?php // require_once('path/vendor/autoload.php'); // Create a new imagick object $image = new Imagick( // Function to rotate an Image $image->rotateimage('green', 25); header("Content-Type: image/jpg"); // Display the output echo $image->getImageBlob(); ?> |
Output:

Related Articles:
Reference: http://php.net/manual/en/imagick.rotateimage.php
Recommended Posts:
- PHP | Gmagick rotateimage() Function
- PHP | Imagick getImageGeometry() Function
- PHP | Imagick getImageDepth() Function
- PHP | Imagick displayImage() Function
- PHP | Imagick getImagePage() Function
- PHP | Imagick setImageDepth() Function
- PHP | Imagick getImageFormat() Function
- PHP | Imagick getImageResolution() Function
- PHP | Imagick readImageBlob() Function
- PHP | Imagick annotateImage() Function
- PHP | Imagick resampleImage() Function
- PHP | Imagick blueShiftImage() Function
- PHP | Imagick getImageLength() Function
- PHP | Imagick adaptiveResizeImage() Function
- PHP | Imagick morphImages() Function
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.



