A tool which fork from grunt-img to optimize PNG and JPG images with pngcrush & jpegtran (jpegtran-turbo on win32).
First, be sure that you have jpegtran installed in your system.
You can install with homebrew
brew install jpeg
Debian, Ubuntu and Mint
apt-get install libjpeg libjpeg-progs
Both libraries are easy to find for RPM distributions too.
Don't worry because both libraries are included.
npm install imagemin
imagemin file/path
imagemin file/path -o new/file/path
var imagemin = require('imagemin');
imagemin(filePath, destDir, callback);
- Grunt-image Helder Santana
- node-pngcrush node-pngcrush