#
Colors Filter
This script utilizes the ApexPainter class from the apexify.js library to Apply color filter on image.
#
Usage
To use the colorsFilter function, follow these steps:
1.Import the ApexPainter class from the apexify.js library:
const { ApexPainter } = require('apexify.js');
import { ApexPainter } from 'apexify.js';
- Create an instance of the
ApexPainterclass:
const painter = new ApexPainter();
3.Call the Method: Call the colorsFilter method with the following parameters:
const imagePath = './image.jpg';
const filterColor = '#ff0000';
const outputBuffer = await painter.colorsFilter(imagePath, filterColor);
4.Use the Output: The outputBuffer variable contains the modified image data in the form of a Buffer.