export declare const bytesToBase64: (bytes: Uint8Array) => string; export declare const base64ToBytes: (base64: string) => Uint8Array; export declare function bytesToDataUri(bytes: Uint8Array, mimeType: string): string; /** Samples per pixel: gray, RGB, RGBA. Maps to PNG colour types 0 / 2 / 6. */ export type PngChannels = 1 | 3 | 4; /** * Encode 8-bit samples as a PNG. * * `pixels` is tightly packed, `channels` samples per pixel, row-major, with no * row padding. Rows are Paeth-filtered and the IDAT is real deflate — an * earlier version emitted zlib *stored* blocks, which made output 77–231× * larger than necessary on real documents. */ export declare function encodePng(pixels: Uint8Array | Uint8ClampedArray, width: number, height: number, channels: PngChannels): Uint8Array; /** * Prefix each row with PNG filter type 4 (Paeth) and filter it in place. * Paeth is a good all-round default: it costs one pass and beats unfiltered * rows on both photographic and flat-colour content. * * One iteration per SAMPLE, so the edges are peeled out and the interior runs * branch-free. Each peeled case follows from the predictor's definition: * * y = 0, x < channels a=b=c=0 → 0 * y = 0, x >= channels b=c=0 → a (Sub) * y > 0, x < channels a=c=0 → b (Up) */ export declare function paethFilterRows(pixels: Uint8Array | Uint8ClampedArray, width: number, height: number, channels: number): Uint8Array;