Optimize (lossless and lossy compression) images (jpeg, png, gif, svg) using external utilities:
- advpng from AdvanceCOMP (will use zopfli on default/maximum level 4)
- jpegtran from Independent JPEG Group's JPEG library or jpeg-turbo. In future will be added mozjpeg.
Based on ImageOptim.app and
image_optim ruby gem.
I am expecting you know basics of image optimization, so for each situation you just choose best runner config yourself for your needs.
- Install from npm.
npm install --save img-optim
OS X: Brew
Tested on 10.9.
brew install advancecomp pngcrush optipng pngquant pngnq libjpeg-turbo jpegoptim
Note about libjpeg-turbo. It is fork of libjpeg and it can be drop-in replacement for libjpeg (almost in all features), but in brew it is installed keg-only and you will need to specify full path to binary
Pngout very good for png compression as it implements own deflate algorithm, but it is very-very slow, and sometimes does not gain any advantage (as advpng implemented zopfli - so probably you will not get any advantage). I recommend use it only if you know that you need it.
You can install
pngout by downloading and installing the binary versions.
Note: pngout is free to use even in commercial soft, but you can not redistribute, repackage or reuse it without consent and agreement of creator. license
svgo is available from NPM.
npm install -g svgo
var images = './url.gif';var Runner = ;var runner = ;runner;