i-scale
v1.0.7
Published
An advanced image optimization tool supporting buffers and configurable options.
Readme
Image Optimizer
An advanced image optimization tool that supports processing buffers and multiple image formats such as JPEG, PNG, WebP, and AVIF.
Installation
npm install i-scaleAPI Usage
Optimize an image buffer:
import { ImageOptimizer } from 'i-scale';
import fs from 'fs';
const inputBuffer = fs.readFileSync('path/to/image.jpg');
const optimizer = new ImageOptimizer();
optimizer.optimizeImageBuffer(inputBuffer, { quality: 80, resize: { width: 400, height: 400 }, format: 'webp' })
.then(optimizedBuffer => {
fs.writeFileSync('path/to/optimized-image.webp', optimizedBuffer);
})
.catch(console.error);License
ISC
Let me know if you need any further changes!
