gulp-jimp-wrapper
v1.1.0
Published
Manipulates images using Jimp.
Downloads
28
Maintainers
Readme
gulp-jimp-wrapper
Manipulates images using Jimp.
Install
npm install --save-dev gulp-jimp-wrapper
Usage
const { src, dest } = require('gulp')
const jimp = require('gulp-jimp-wrapper')
exports.default = () => {
return src('./src/img/*')
.pipe(
jimp(image => image.resize(256, 256).quality(60).greyscale(), {
extname: '.min.png'
})
)
.pipe(dest('./dist/img'))
}
or use ES module
import jimp from 'gulp-jimp-wrapper'
API
type Callback = (image: Jimp ) => Jimp
interface Options = { basename?: string, extname?: string }
declare const gulpJimp: (cb: Callback, opts?: Options) => stream.Transform
See jimp #methods for the full documentation.
Note that basename
option should only be used when gulp.src()
takes in one single file.
Be careful with the Jimp.write()
method.
License
MIT License © 2020 Exuanbo