Open In App

PHP | Imagick polaroidImage() Function

Last Updated : 09 Jul, 2019
Improve
Improve
Like Article
Like
Save
Share
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
   
// Create a new object
$image = new Imagick(
   
// Use polaroidImage() function
$image->polaroidImage(new ImagickDraw(), 25);
   
// Image header
header('Content-type: image/png');
   
// Display resulting image
echo $image;
   
?>


Output:


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads