imagemin-zopfli
zopfli imagemin plugin
Install
$ npm install --save imagemin-zopfli
Usage
var Imagemin = require('imagemin');
var zopfli = require('imagemin-zopfli');
var imagemin = new Imagemin()
.src('images/*.png')
.dest('build/images')
.use(zopfli({ more: true }));
imagemin.run(function (err, files) {
if (err) {
throw err;
}
console.log('Files optimized successfully!');
});
You can also use this plugin with gulp:
var gulp = require('gulp');
var zopfli = require('imagemin-zopfli');
gulp.task('default', function () {
return gulp.src('images/*.png')
.pipe(zopfli())
.pipe(gulp.dest('build/images'));
});
Options
8bit
Type: Boolean
Default: false
Convert 16-bit per channel image to 8-bit per channel.
more
Type: Boolean
Default: false
Compress more using more iterations (depending on file size).
License
MIT © imagemin