0.2.0 • Published 5 years ago

gulp-imgr v0.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

gulp-imgr

An image manipulation plugin for gulp. Resize, Optimise and save all your images with one simple plugin. This plugin is useful if your a developer that receives a ton of high-resolution/filesize images aswell as anything but jpg. This plugin completely removes the need for ever touching your images. gulp-imgr is a work in progress.

Features

  • Highly Configurable
  • Designed to output web friendly images

Getting Started

Install the gulp-imgr using NPM or your favourite node package manager

$ npm install gulp-imgr

Add gulp-imgr to your gulpfile

var gulpImgr = require('gulp-imgr');

Create a gulp task to start processing images

gulp.task('images', function(done) {
  return gulp.src( imageFiles )
    .pipe(gulpImgr({
      maxWidth: 1000,
      maxHeight: 800,
      quality: 70,
      maxFilesize: 400,
      outputFormat: 'jpg',
      styles: {
        small: {
          maxWidth: 600,
          quality: 75
        }
      }
    }))
    .pipe(gulp.dest( './assets/img/' ))
});

Configuration

OptionTypeDefaultDescription
maxWidthint1000Set the maximum width the image can have. It'll be resized if its over
qualityint70The compression quality of the outputted image
formatstringjpgOutputted image format
stylesobjectnullContains additional image styles
convertSvgbooltrueConvert any SVGs to your specified format