gulp-image
Optimize PNG, JPEG, GIF, SVG images with gulp task.
Install
$ npm install --save-dev gulp-image
Usage
This is an example of gulpfile.js
.
var gulp = ;var image = ; gulp; gulp;
You can pass an object to image()
as argument such as following:
gulp.task('image', function () {
gulp.src('./fixtures/*')
.pipe(image({
pngquant: true,
optipng: false,
zopflipng: true,
advpng: true,
jpegRecompress: false,
jpegoptim: true,
mozjpeg: true,
gifsicle: true,
svgo: true
}))
.pipe(gulp.dest('./dest'));
});
Set false
if you don't want to apply.