Imagine is a nice looking image manipulation library for PHP 5.3+ that supports GD2, ImageMagick, and GraphicsMagick in a clean, chainable API from Bulat Shakirzyanov:

<?php

$imagine = new ImagineGdImagine();
// or
$imagine = new ImagineImagickImagine();
// or
$imagine = new ImagineGmagickImagine();

$size    = new ImagineImageBox(40, 40);

$mode    = ImagineImageImageInterface::THUMBNAIL_INSET;
// or
$mode    = ImagineImageImageInterface::THUMBNAIL_OUTBOUND;

$imagine->open('/path/to/large_image.jpg')
    ->thumbnail($size, $mode)
    ->save('/path/to/thumbnail.png')
;

Check out the extremely detailed project docs and examples for advanced usage.


Have comments? Send a tweet to @TheChangelog on Twitter.

Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.