janisto / ImageUtil

Easy resize, filter and compression class for images.
http://www.mikkonen.info/imageutil/
6 stars 0 forks source link

ImageUtil

Easy resize, filter and compression class for images.

All image manipulations are applied to a temporary image. Only the save() method is permanent.

Requires: PHP5 and GD2 library.

Optional: jpegtran, pngcrush.

Changelog

v2.1

v2.0

v1.6

v1.5

v1.4

v1.3

v1.2

v1.1

Usage

include 'ImageUtil.php';

// an absolute URL or path to file. Can be .jpg, .jpeg, .gif or .png
$img = new ImageUtil('images/large/input1.jpg');
// set width and height and then render image. Can be .jpg, .jpeg, .gif or .png
$img->resize(320, 240)->render('output.jpg');

// an absolute URL or path to file. Can be .jpg, .jpeg, .gif or .png
$img = new ImageUtil('images/large/input2.jpg');
// set width, height and image resize option
$img->resize(150, 100, 'crop')
    // add watermark
    ->watermark('images/large/watermark.png')
    // save path to file. Can be .jpg, .jpeg, .gif or .png
    ->save('images/small/output.jpg');

Documentation

Documentation can be found here: http://janisto.github.com/ImageUtil/

Examples

Examples can be found here: http://www.mikkonen.info/imageutil/

License

ImageUtil is free and unencumbered public domain software.