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.
What are @jimp/plugin-invert's main functionalities?
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);
});
Other packages similar to @jimp/plugin-invert
sharp
Sharp is a high-performance image processing library that supports a wide range of image transformations, including color inversion. It is known for its speed and efficiency, especially with large images.
gm
GraphicsMagick (gm) is a comprehensive image processing library that provides a wide array of image manipulation features, including color inversion. It is a Node.js wrapper for the GraphicsMagick command-line tool.
image-js
Image-js is a versatile image processing library for JavaScript that supports various image manipulation tasks, including color inversion. It is designed to be easy to use and integrate into web applications.
@jimp/plugin-invert
Invert an image's colors.
Invert an image's colors.
Usage
- @param {function(Error, Jimp)} cb (optional) a callback for when complete
import jimp from "jimp";
async function main() {
const image = await jimp.read("test/image.png");
image.invert();
}
main();
v0.22.12 (Fri Feb 23 2024)
:tada: This release contains work from a new contributor! :tada:
Thank you, Dathan (@DLiblik), for all your work!
🚀 Enhancement
🐛 Bug Fix
Authors: 3