#
Resizing Images
This script utilizes the ApexPainter
class from the apexify.js
library to resize images
.
#
Usage
To create a GIF using the ApexPainter
class, follow these steps:
const { ApexPainter } = require('apexify.js');
import { ApexPainter } from 'apexify.js';
1.Create an instance of the ApexPainter
class:
const painter = new ApexPainter();
2.Define the options for the Resizing:
- Prepare an array of images to include in the GIF. Each image should be represented as an object with the following properties:
const resizedOptions = {
imagePath: './image.png',
size: { width: 300, height: 500 }
}
3.Generate The Resized Image:
const outputResized = await painter.resize(resizedOptions);
console.log(outputResized); // Returns a buffer image.