Imagine - Unified PHP 5.3 API for GD2, ImageMagick, GraphicsMagick

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.

News Films

Our little film studio focuses on telling developer-centric stories that need to be seen.

Beyond Code: Season 3 / GopherCon 2015

 
0:00 / 0:00