What is @jimp/plugin-invert?
@jimp/plugin-invert is a plugin for the Jimp image processing library that allows you to invert the colors of an image. This can be useful for various image manipulation tasks, such as creating negative images or enhancing visual contrast.
Invert Colors
This feature inverts the colors of the image. The code reads an image from a specified path, inverts its colors, and then writes the modified image to a new file.
const Jimp = require('jimp');
Jimp.read('path/to/image.jpg')
.then(image => {
image.invert()
.write('path/to/output.jpg');
})
.catch(err => {
console.error(err);
});