Polaroid effect with phMagick

August 9, 2009 by nuno costa 5 comments

phMagick :: Polaroid Effect

We can add a polaroid effect to images.

We have two options a fake polaroid effect, which is mainly adding the withe borders an a real polaroid effect with text and shading witch make a very realistic effect

Fake Polaroid

 

$phMagick = &new phMagick('lipe1.jpg');
$phMagick->setDestination('fake_polaroid.png')
 ->fakePolaroid();

 

Result

 

 

Real Polaroid

 

//lets add some text to our polarid
$text = new phMagickTextObject();
$text->color('#464646')
 ->text('It Lives master!!!!');
 
$phMagick = &new phMagick('lipe1.jpg');
$phMagick->setDestination('polaroid1.png')
 ->polaroid($text,8); //draw the polaroid with some rotation

 

Result

 

Note that the image not only has the polaroid frame, but the photo has also been given a bit of a ‘curl' with appropriate shadow adjustments, giving the resulting image more depth.

 

5 comments so far Add Your Comment

  1. by MrMagic on December 13 2009 at 00:49

    Hello,

    I installed your script and i tried to use the polaroid effect, but every time it apply the effect, but the text doesn’t appear…

    phMagick gives no errors, a 0 status and the images is correctly created, except for the text.

    Which is the problem?
    Thanks

  2. by nuno costa on December 15 2009 at 16:48

    @MrMagic,

    Please check your email

  3. by chad on February 7 2010 at 20:32

    I saw a example on the http://www.imagemagick.org/ site but there was a way to sharpen the image as its blurry, how would you do that with yours?

    so far i like the ease of using your wrapper, will it allow for anything that we see on this site?

    http://www.imagemagick.org/

    thanks!

  4. by nuno costa on February 12 2010 at 23:45

    Thaks Chad.

    phMagick can do that, but a plugin must be created for that

    If you can send me the link for the example I can try to build the plugin, but I can’t promise to be quick, I’m under a great workload right now

  5. by webdesign on May 31 2011 at 14:08

    there’s a bug if you try to save jpeg-polaroids with white background -> shadow is not visible because shadow-color gets also white -> FIX like described below

    change decorations.php line 150:
    FROM : $cmd .= ‘ -bordercolor “‘. $borderColor.’” -background “‘.$background.’” -polaroid ‘ . $rotation .’ -background “‘. $borderColor.’” -flatten ‘;

    TO: $cmd .= ‘ -bordercolor “‘. $borderColor.’” -background “‘.$background.’” -polaroid ‘ . $rotation .’ -background “‘. $shaddowColor.’” -flatten ‘;

More from francodacosta.com

© francodacosta.com - All rights reserved