Open In App

PHP | Imagick polaroidImage() Function

Last Updated : 09 Jul, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The Imagick::polaroidImage() function is an inbuilt function in PHP which is used to simulate a polaroid picture. This function rotates the image with the polaroid frame by a given angle. Note: This method is available only if Imagick has been compiled against version 6.3.2 or above. Syntax:
bool Imagick::polaroidImage( $properties, $angle )
Parameters: This function accepts two parameters as mentioned above and described below:
  • $properties: This parameter holds the property of the Polaroid image. It can be set to 'ImagickDraw()' if no changes in properties are considered.
  • $angle: This parameter holds the polaroid angle, through which the entire picture (with frame) are rotated.
Return Value: This function returns True on success. Original Image: Program: php
<?php
 
// Create a new object
$image = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/20190708094104/g128-300x246.png');
 
// Use polaroidImage() function
$image->polaroidImage(new ImagickDraw(), 25);
 
// Image header
header('Content-type: image/png');
 
// Display resulting image
echo $image;
 
?>
Output:

Next Article

Similar Reads