UNPKG

lightningimg

Version:

A blazing fast, transparent, and safe image converter powered by WebAssembly. Convert PNG, JPG, TIFF, and GIF images to optimized WebP format with high performance and cross-platform compatibility.

26 lines (25 loc) 1.07 kB
/* tslint:disable */ /* eslint-disable */ export function init_panic_hook(): void; /** * Converts an image buffer to WebP format. * This is the core function that browsers and Node.js can use. */ export function convert_image_buffer(input_buffer: Uint8Array, width?: number, height?: number): Uint8Array; /** * Determines if an image format is supported based on the first few bytes. */ export function is_supported_format(buffer: Uint8Array): boolean; /** * Get image format information from buffer */ export function get_image_info(buffer: Uint8Array): any; /** * Processes all images in a directory recursively, converting them to WebP format. * This function is designed to work in Node.js environments where fs module is available. */ export function process_directory(_input_dir: string, _output_dir?: string): void; /** * Processes all images in a directory recursively, converting them to WebP format and optionally keeping original file names. */ export function process_directory_destructive(_input_dir: string, _keep_original_names?: boolean): void;