A PHP class for optimizing images using best practice. It also includes a CLI interface that you can use for build or commit check.
PHP
Latest commit 1e0ce31 Feb 13, 2013 Joseph Chiang Trimg the last space.
Permalink
Failed to load latest commit information.
OptimizeImage.php
README.md
optimg

README.md

optimg

A PHP class for optimizing images according to Stoyan Stefanov's Image Optimization articles. It also includes a CLI interface that you can use for build or commit check. Yahoo! has a similar tool called Smush.it. This tool basicly provides the same functionality as it.

Dependencies

You need to have the following executable command-line tools installed in your operating system.

  • ImageMagick
  • jpegtran
  • pngcrush
  • gifsicle
  • pngquant
  • pngout

Installation

$ git clone git://github.com/josephj/optimg.git
$ cd optimg
$ chmod +x optimg
$ ./optimg

Usage

Usage: optimg [options] image_path

  -c, --check-only   Check if path has fully optimized.
  -r, --report-only  Show report without really optimization.
  --png8             Transform all PNG files to PNG8 format.