Thumbnails by combining a drop-in shadow with round corners : Create and modify images : Graphics Image PHP Source Code


PHP Source Code » Graphics Image » Create and modify images »

 

Thumbnails by combining a drop-in shadow with round corners


Imagick::thumbnailImage also strips all the associated profiles to make the image optimal to use in web applications.

Once again, the original image:

strawberry

And the results:

shadow

<?php
/* Read the image into the object */
$im = new Imagick'strawberry.png' );
/* Make the image a little smaller, maintain aspect ratio */
$im->thumbnailImage200null );
/* Round corners, web 2.0! */
$im->roundCorners5);
/* Clone the current object */
$shadow $im->clone();
/* Set image background color to black
        (this is the color of the shadow) */
$shadow->setImageBackgroundColor( new ImagickPixel'black' ) );
/* Create the shadow */
$shadow->shadowImage8035);
/* Imagick::shadowImage only creates the shadow.
        That is why the original image is composited over it */
$shadow->compositeImage$imImagick::COMPOSITE_OVER0);
/* Display the image */
header"Content-Type: image/png" );
echo 
$shadow;
?>




HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Graphics Image
» Create and modify images