Mika Scraper / enhanceImage
Function: enhanceImage()
enhanceImage(
options):Promise<Buffer<ArrayBufferLike>>
This function sends an image to ihancer.com for enhancement and returns the enhanced image as a Buffer.
Parameters
options
The parameter options is of type EnhanceImageOptions. It includes the image buffer or path, alongside flags to determine how the enhanced image should be saved.
Returns
Promise<Buffer<ArrayBufferLike>>
This promise resolves to a Buffer containing the enhanced image data.
Example
import { enhanceImage } from 'mika-scraper';
const options = {
image: 'path/to/image.jpg', // or a Buffer containing image data
saveAs: 'output/path/enhanced-image.jpg' // optionally specify where to save the output
};
enhanceImage(options)
.then((enhancedImageBuffer) => {
// Use the enhanced image buffer for further processing or saving
})
.catch((error) => {
console.error('Error enhancing image:', error);
});Last updated on