PHP | Imagick rotateImage() Function Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Below program illustrate Imagick::rotateImage() function in PHP: Original Image: Program: php <?php // require_once('path/vendor/autoload.php'); // Create a new imagick object $image = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-12.png'); // Function to rotate an Image $image->rotateimage('green', 25); header("Content-Type: image/jpg"); // Display the output echo $image->getImageBlob(); ?> Output: Related Articles: PHP | Imagick borderImage() Function PHP | Imagick annotateImage() Function Reference: https://www.php.net/manual/en/imagick.rotateimage.php Comment More infoAdvertise with us Next Article PHP | Gmagick rotateimage() Function S sarthak_ishu11 Follow Improve Article Tags : Misc Web Technologies PHP Image-Processing PHP-Imagick +1 More Practice Tags : Misc Similar Reads PHP | Gmagick rotateimage() Function The Gmagick::rotateimage() function is an inbuilt function in PHP which is used to rotate an image in the specified number of degrees. The background empty triangles filled with the background color.Syntax:Â Â Gmagick Gmagick::rotateimage ( $color, $degrees ) Parameters: This function accepts two par 2 min read PHP | Gmagick rotateimage() Function The Gmagick::rotateimage() function is an inbuilt function in PHP which is used to rotate an image in the specified number of degrees. The background empty triangles filled with the background color.Syntax:Â Â Gmagick Gmagick::rotateimage ( $color, $degrees ) Parameters: This function accepts two par 2 min read PHP | Imagick rollImage() Function The Imagick::rollImage() function is an inbuilt function in PHP which is used to roll an image. Syntax: bool Imagick::rollImage( $x, $y ) Parameters: This function accepts two parameters as mentioned above and described below: $x: This parameter stores the value of the X offset. $y: This parameter s 1 min read PHP | Imagick rollImage() Function The Imagick::rollImage() function is an inbuilt function in PHP which is used to roll an image. Syntax: bool Imagick::rollImage( $x, $y ) Parameters: This function accepts two parameters as mentioned above and described below: $x: This parameter stores the value of the X offset. $y: This parameter s 1 min read PHP | Imagick readImage() Function The Imagick::readImage() function is an inbuilt function in PHP which is used to read an image from filename. Syntax: bool Imagick::readImage( string $filename ) Parameters:This function accepts a single parameter $filename which holds the name of the file. It can also accept URL of the file. Return 1 min read PHP | Imagick shadeImage() Function The Imagick::shadeImage() function is an inbuilt function in PHP which is used to creates a 3D effect of a given image. Shines a distant light on an image to create a three-dimensional effect. The azimuth is measured in degrees of x-axis and elevation is measured in pixels above the z-axis. Syntax: 1 min read Like