gulp-sharp-resize
Gulp Image Processor for generating responsive, scaled images for img, srcset and picture tags
Last updated 5 years ago by enounca .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-sharp-resize 
SYNC missed versions from official npm registry.

Build Status

dependencies devDependency Status

NPM version

built for gulp

gulp-sharp-resize

CAUTION: This module still has kinks and is in progress - its usable but your mileage may vary

Gulp Image Processor for generating responsive, scaled images for img, srcset and picture tags

var gulp = require('gulp');
var imgResize = require('gulp-sharp-resize');

gulp.task('image:resize', function () {
    return gulp.src('src/**/*.{jpg,jpeg,png,gif}')
        .pipe(imgResize({
            ignore: ['*.xcf', 'mask-image.png'],
            interpolate: "bicubic",
            resize: [ "1x", "2x", "1.5x" ],
            outputFormat: "webp",
            quality: 100
        }))
        .pipe(gulp.dest('dist/images'));
});

Descripion of the available optons

var options = {
    ignore: String|Array[String], // Optional: strings of file globs (*.xcf) and/or filenames to ignore
    interpolate: String, // Optional: Interpolation function to use - defaults to
    resize: Array[String], // Required: Strings of the sizes to be resize for each image - ie "1.5x", "2x"
    outputFormat: String, // Optional: the output format to use - will default to the source format
    quality: Integer // Optional quality factor to apply - webp can be tricky with lower values when the image has a large color space
}

Planned Features

Extended resize formats, per file, per folder config for images and image sets, webpack & templating support (handlebars) for img sets

Twitter

Donate to help support development

Current Tags

  • 0.4.0                                ...           latest (5 years ago)

1 Versions

  • 0.4.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (11)
Dev Dependencies (3)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |