Image Optimizer
Image Optimizer optimizes given JPEG and PNG images or images in given folder. Uses several encoders for achieving the best possible lossless compression ratio and tries to employ the most advanced methods such as JPEG algorithmic encoding if available or PNG transparent pixels stripping and automatic color reduction. Performs the following for PNG:
- converts the PNG file using
gimp
to the XCF format, - converts XCF back to the PNG without transparent pixels using
xcf2png
, - optimizes it using
pngcrush
oroptipng
.
Or:
- rewrites the PNG file using
convert
, - optimizes it using
pngcrush
oroptipng
.
And for JPEG:
- strips all unnecessary metadata using
jpegoptim
, - optimizes using
jpegtran
.
Usage
For command line usage see help for the image-optimizer
command.
For usage as library see source of the image-optimizer
command.
Requirements
Following software for full functionality is necessary:
- Ruby (required),
- Bash (required),
- GIMP,
- ImageMagick,
- Jpegtran,
- Jpegoptim,
- OptiPNG,
- Pngcrush,
- Xcftools.
Steps which requires non-strictly required components will be silently ignored if these components will not be available.
Contributing
- Fork it.
- Create a branch (
git checkout -b 20101220-my-change
). - Commit your changes (
git commit -am "Added something"
). - Push to the branch (
git push origin 20101220-my-change
). - Create an Issue with a link to your branch.
- Enjoy a refreshing Diet Coke and wait.
Copyright
Copyright © 2011 Martin Kozák. See LICENSE.txt
for
further details.