I added a couple of comfortablity methods to the Imagick extension. The first one is Imagick::cropThumbnailImage which can be used to create fixed size thumbnails from any image geometry.

The second one was Imagick::roundCorners. It was a little tricky to implement but after staying up all night banging my head to the wall I finally succeeded. It's now possible to create round corners with ease:

PHP:
  1. <?php
  2.  
  3. /* Create a new object and read the image */
  4. $im = new Imagick( 'img.png' );
  5.  
  6. /* Round the corners. (yes, this is all that is needed.) */
  7. $im->roundCorners( 30, 30 );
  8.  
  9. /* Output the image */
  10. header( "Content-Type: image/png" );
  11. echo $im;
  12.  
  13. ?>

Bookmark and Share