zopfli imagemin plugin
$ npm install --save imagemin-zopfli
var Imagemin = require('imagemin');
var imageminZopfli = require('imagemin-zopfli');
new Imagemin()
.src('images/*.png')
.dest('build/images')
.use(imageminZopfli({more: true}))
.run();
You can also use this plugin with gulp:
var gulp = require('gulp');
var imageminZopfli = require('imagemin-zopfli');
gulp.task('default', function () {
return gulp.src('images/*.png')
.pipe(imageminZopfli({more: true})())
.pipe(gulp.dest('build/images'));
});
Type: boolean
Default: false
Convert 16-bit per channel image to 8-bit per channel.
Type: boolean
Default: false
Allow altering hidden colors of fully transparent pixels.
Type: int
Default: 15
Number of iterations for small images < 200 KiB.
Type: int
Default: 5
Number of iterations for large images > 200 KiB.
Type: boolean
Default: false
Compress more using more iterations (depending on file size).
MIT © imagemin