/** * WebP encoding and decoding functions * Simplified API matching Golang implementation */ import { WebPEncodeOptions, WebPDecodeOptions, DecodedImage } from './types'; /** * Encode an image file (JPEG, PNG, etc.) to WebP format * * @param imageFileData - Buffer containing image file data (JPEG, PNG, etc.) * @param options - WebP encoding options * @returns WebP encoded data as Buffer * @throws NextImageError if encoding fails * * Example: * ```typescript * import { encodeWebP } from '@ideamans/libnextimage'; * import * as fs from 'fs'; * * const jpegData = fs.readFileSync('input.jpg'); * const webpData = encodeWebP(jpegData, { quality: 80 }); * fs.writeFileSync('output.webp', webpData); * ``` */ export declare function encodeWebP(imageFileData: Buffer, options?: WebPEncodeOptions): Buffer; /** * Decode WebP data to pixel data * * @param webpData - Buffer containing WebP encoded data * @param options - WebP decoding options * @returns Decoded image with pixel data * @throws NextImageError if decoding fails * * Example: * ```typescript * import { decodeWebP } from '@ideamans/libnextimage'; * import * as fs from 'fs'; * * const webpData = fs.readFileSync('input.webp'); * const decoded = decodeWebP(webpData); * console.log(`Decoded ${decoded.width}x${decoded.height} image`); * // decoded.data contains raw pixel data (RGBA by default) * ``` */ export declare function decodeWebP(webpData: Buffer, options?: WebPDecodeOptions): DecodedImage; //# sourceMappingURL=webp-old.d.ts.map