$ npm install @jimp/plugin-threshold
Lightens an image.
This is useful as a simplified method for processing scanned drawings, signatures, etc
import jimp from 'jimp';
async function main() {
const image = await jimp.read('test/image.png');
image.threshold({ max: 150 });
// or
image.threshold({ max: 200, replace: 200, autoGreyscale: false });
}
main();
© 2010 - cnpmjs.org x YWFE | Home | YWFE