What is @jimp/plugin-color?
@jimp/plugin-color is a plugin for the Jimp image processing library that provides various color manipulation functionalities. It allows users to perform operations such as adjusting brightness, contrast, and applying color filters to images.
What are @jimp/plugin-color's main functionalities?
Adjust Brightness
This feature allows you to adjust the brightness of an image. The value can range from -1 (darken) to 1 (brighten).
const Jimp = require('jimp');
Jimp.read('path/to/image.jpg').then(image => {
image.brightness(0.5) // increase brightness by 50%
.write('path/to/output.jpg');
});
Adjust Contrast
This feature allows you to adjust the contrast of an image. The value can range from -1 (decrease contrast) to 1 (increase contrast).
const Jimp = require('jimp');
Jimp.read('path/to/image.jpg').then(image => {
image.contrast(0.5) // increase contrast by 50%
.write('path/to/output.jpg');
});
Apply Color Filter
This feature allows you to apply a color filter to an image. You can specify the color and the intensity of the filter.
const Jimp = require('jimp');
Jimp.read('path/to/image.jpg').then(image => {
image.color([{ apply: 'red', params: [100] }]) // apply red filter
.write('path/to/output.jpg');
});
Other packages similar to @jimp/plugin-color
sharp
Sharp is a high-performance image processing library that supports various color manipulation functionalities such as brightness, contrast, and color filters. It is known for its speed and efficiency compared to Jimp.
gm
GraphicsMagick (gm) is a powerful image processing library that provides extensive color manipulation features. It is more feature-rich and can handle a wider range of image formats compared to Jimp.
image-js
Image-js is a versatile image processing library that offers various color manipulation functionalities. It is designed to be easy to use and integrates well with other JavaScript libraries.