Imagine is an object-oriented PHP library for working with images and manipulating them. The library can handle frequently-used operations like resize, crop or applying filters. A color class helps generating the RGB values of any given color and methods exist for drawing shapes like arc, ellipse, line, pieSlice and more.

Imagine is a OOP library for image manipulation built in PHP 5.3 using the latest best practices and thoughtful design that should allow for decoupled and unit-testable code.

Is possible to load any font file and insert text into images with a flexible font class. Imagine is a frequently-updated library with an exciting to-do-list like charting, reflection and rounded corner filters.

How to Use

< ?php

$imagine = new Imagine\Gd\Imagine();
$size    = new Imagine\Image\Box(40, 40);
$mode    = Imagine\Image\ImageInterface::THUMBNAIL_INSET;
// or
$mode    = Imagine\Image\ImageInterface::THUMBNAIL_OUTBOUND;

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

Website: http://imagine.readthedocs.org/
Download: https://github.com/avalanche123/Imagine

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

two × three =

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like

Fast, Effective PHP Compression With .htaccess

PHP compression is an excellent method of conserving bandwidth and reducing client download times. We have already discussed an excellent method for CSS compression, and in this article we share a super-easy technique for compressing all PHP content without editing a single file.

Calculate folder and subfolders size with PHP

How to read the size of a directory using PHP? Here is a simple function which could help read the size of the directory, number of directories and the number of files in the given directory.