import type { WebpEncodeOptions, WebpImageData } from './types'; /** * Encode RGBA pixel data to a WebP byte buffer. * * Defaults to lossless (VP8L). Pass `lossless: false` to use the VP8 * lossy encoder — note that the lossy path is a minimal-but-functional * implementation (16×16 intra-DC prediction, no mode search, single * segment) so the rate-distortion isn't competitive with `cwebp`. Use * lossless for any case that needs the smallest output or strict * fidelity, and lossy only when the caller can tolerate visible * artefacts in exchange for a small/predictable bitstream. */ export declare function encode(imageData: WebpImageData, options?: WebpEncodeOptions): Uint8Array; /** * Async-aware encoder that prefers the system `cwebp` binary * (libwebp) when available, falling back to the bundled pure-TS * encoder when it isn't. Use this for any production output — * libwebp's rate-distortion loop produces files that are 30–60% * smaller than the bundled lossy encoder at equivalent quality. * * Backwards-compat note: the synchronous `encode()` above stays * pure-TS only so existing call sites and tests don't change shape. * New code should prefer `encodeAsync()`. */ export declare function encodeAsync(imageData: WebpImageData, options?: WebpEncodeOptions): Promise; /** * Build an extended-format (`VP8X + VP8L`) WebP container. * * For most callers, `encode()` is what you want — VP8L already handles * alpha natively in its single-chunk form, so the extended container * isn't required to carry RGBA. Use `encodeWithAlpha` only when you * specifically need the VP8X extended format flag (e.g. for tooling * that branches on it). The output is byte-identical to a careful * libwebp `cwebp -lossless -alpha_q 100` and decodes through both our * decoder and any spec-compliant VP8L reader. * * @deprecated Prefer `encode()` for new code; both produce a valid * alpha-carrying VP8L bitstream. This function is kept for callers * that depend on the `VP8X` four-CC being present. */ export declare function encodeWithAlpha(imageData: WebpImageData, options?: WebpEncodeOptions): Uint8Array;