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.
Copyright
Copyright © 2011 – 2015 Martin Poljak. See LICENSE.txt
for
further details.