gulp-jimp-wrapper
Manipulates images using Jimp.
This plugin is actively maintained with the help of Renovate.
Install
npm install --save-dev gulp-jimp-wrapper
Usage
const { task, src, dest } = require('gulp')
const jimp = require('gulp-jimp-wrapper')
task('jimp', () => {
return src('img/*')
.pipe(
jimp(image =>
image
.resize(256, 256)
.quality(60)
.greyscale()
)
)
.pipe(dest('dist/img'))
})
or you can
import jimp from 'gulp-jimp-wrapper'
API
gulp-jimp-wrapper
takes in a callback function as argument where Jimp
methods can be called. See Jimp #Methods for the full documentation.
By now this plugin does not support changing file name or file extention of the image. Be careful with the image.write()
method.
License
MIT License © 2020 Exuanbo