gulp-image
Optimize PNG, JPG, GIF, SVG images with gulp task.
Last updated a year ago .
· Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-image 
SYNC missed versions from official npm registry.

gulp-image GitHub Actions Status

Optimize PNG, JPEG, GIF, SVG images with gulp task.

gulp-image result

Install

$ npm install --save-dev gulp-image

External Dendencies

  • brew install libjpeg libpng on macOS
  • apt-get install -y libjpeg libpng on Ubuntu
  • npm install -g windows-build-tools on Windows

Usage

This is an example of gulpfile.js.

import gulp from 'gulp';
import image from 'gulp-image';

gulp.task('image', function () {
  gulp.src('./fixtures/*')
    .pipe(image())
    .pipe(gulp.dest('./dest'));
});

gulp.task('default', ['image']);

You can pass an object to image() as argument such as following:

gulp.task('image', () => {
  gulp.src('./fixtures/*')
    .pipe(image({
      pngquant: true,
      optipng: false,
      zopflipng: true,
      jpegRecompress: false,
      mozjpeg: true,
      gifsicle: true,
      svgo: true,
      concurrent: 10,
      quiet: true // defaults to false
    }))
    .pipe(gulp.dest('./dest'));
});

Set false for optimizers which you don't want to apply. And you can set concurrent option to limit the max concurrency in execution. You can also set quiet to avoid logging out results for every image processed.

You can configure parameters applied to each optimizers such as following:

gulp.task('image', () => {
  gulp.src('./fixtures/*')
    .pipe(image({
      optipng: ['-i 1', '-strip all', '-fix', '-o7', '-force'],
      pngquant: ['--speed=1', '--force', 256],
      zopflipng: ['-y', '--lossy_8bit', '--lossy_transparent'],
      jpegRecompress: ['--strip', '--quality', 'medium', '--min', 40, '--max', 80],
      mozjpeg: ['-optimize', '-progressive'],
      gifsicle: ['--optimize'],
      svgo: ['--enable', 'cleanupIDs', '--disable', 'convertColors']
    }))
    .pipe(gulp.dest('./dest'));
});

License

MIT © Shogo Sensui

Current Tags

  • 6.3.1                                ...           latest (a year ago)

84 Versions

  • 0.0.1                                ...           9 years ago
  • 0.0.2                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
  • 0.1.1                                ...           9 years ago
  • 0.1.2                                ...           9 years ago
  • 0.1.3                                ...           9 years ago
  • 0.1.4                                ...           9 years ago
  • 0.1.5                                ...           9 years ago
  • 0.1.6                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.2.1                                ...           9 years ago
  • 0.3.0                                ...           9 years ago
  • 0.3.1                                ...           9 years ago
  • 0.3.2                                ...           9 years ago
  • 0.3.3                                ...           9 years ago
  • 0.3.4                                ...           9 years ago
  • 0.4.0                                ...           9 years ago
  • 0.4.1                                ...           9 years ago
  • 0.4.2                                ...           9 years ago
  • 0.4.3                                ...           9 years ago
  • 0.4.6                                ...           8 years ago
  • 0.4.7                                ...           8 years ago
  • 0.4.8                                ...           8 years ago
  • 0.5.0                                ...           8 years ago
  • 0.5.1                                ...           8 years ago
  • 0.5.2                                ...           8 years ago
  • 0.5.3                                ...           8 years ago
  • 0.5.4                                ...           8 years ago
  • 0.5.5                                ...           8 years ago
  • 0.5.6                                ...           8 years ago
  • 0.5.7                                ...           8 years ago
  • 0.5.8                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.3                                ...           7 years ago
  • 1.0.4                                ...           7 years ago
  • 1.0.5                                ...           7 years ago
  • 1.0.6                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.2                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.2.1                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.3.1                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 2.0.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.1.1                                ...           7 years ago
  • 2.1.2                                ...           7 years ago
  • 2.1.3                                ...           7 years ago
  • 2.2.0                                ...           7 years ago
  • 2.3.0                                ...           7 years ago
  • 2.4.0                                ...           7 years ago
  • 2.4.1                                ...           7 years ago
  • 2.5.0                                ...           6 years ago
  • 2.6.0                                ...           6 years ago
  • 2.7.0                                ...           6 years ago
  • 2.7.1                                ...           6 years ago
  • 2.7.2                                ...           6 years ago
  • 2.7.3                                ...           6 years ago
  • 2.7.4                                ...           6 years ago
  • 2.7.5                                ...           6 years ago
  • 2.7.6                                ...           6 years ago
  • 2.8.0                                ...           6 years ago
  • 2.9.0                                ...           6 years ago
  • 2.10.0                                ...           6 years ago
  • 2.10.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 4.1.0                                ...           5 years ago
  • 4.2.0                                ...           5 years ago
  • 4.3.0                                ...           5 years ago
  • 4.4.0                                ...           4 years ago
  • 4.4.1                                ...           4 years ago
  • 5.0.0                                ...           4 years ago
  • 5.1.0                                ...           4 years ago
  • 6.0.0                                ...           3 years ago
  • 6.1.0                                ...           3 years ago
  • 6.2.0                                ...           3 years ago
  • 6.2.1                                ...           3 years ago
  • 6.3.0                                ...           a year ago
  • 6.3.1                                ...           a year ago
Maintainers (1)
Dependencies (18)
Dev Dependencies (4)

Copyright © npmmirror.com | 浙ICP备15033595号-63 |