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.
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 can be found here: http://janisto.github.com/ImageUtil/
Examples can be found here: http://www.mikkonen.info/imageutil/
ImageUtil is free and unencumbered public domain software.