Here is an example of how to create a polaroid style effect on an image. This effect is available if you have compile Imagick against ImageMagick 6.2.8 or newer:

PHP:
  1. <?php
  2.  
  3. /* Create the object and create the image */
  4. $im = new Imagick( 'chev7_orig.png' );
  5.  
  6. /* Create a new ImagickDraw object
  7.    This is used to set polaroid properties */
  8. $draw = new ImagickDraw();
  9.  
  10. /* Set the fill color to light blue */
  11. $draw->setFillColor( new ImagickPixel( 'light blue' ) );
  12.  
  13. /* Create the polaroid image */
  14. $im->polaroidImage( $draw, 20 );
  15.  
  16. /* Output */
  17. header( "Content-Type: image/png" );
  18. echo $im;
  19.  
  20. ?>

Here is the original image:

orig

And here is the image with the polaroid effect:

polaroid

Bookmark and Share