/** * Just enough image codec to make mask and similarity decisions without a native dependency. * * PNG decoding and encoding cover masks and perceptual hashing; broader format support belongs * behind the injectable `decode` hooks rather than in this module. Header sniffing lives in * `image-header.ts` and is re-exported here. */ export { type ImageDimensionsInfo, readImageDimensions, type SniffedImage, type SniffedImageFormat, sniffImageType, } from './image-header.js'; /** Decoded pixels, always expanded to 8-bit RGBA so callers need no per-format branches. */ export interface RgbaImage { /** Width in pixels. */ width: number; /** Height in pixels. */ height: number; /** Pixels as RGBA, 4 bytes each, row by row. */ data: Uint8Array; } /** Options for `decodePng()`. */ export interface DecodePngOptions { /** * Refuses to allocate pixel memory past this count. Checked against the header before * decompression, so a small file claiming enormous dimensions is rejected before it costs * anything. */ maxPixels?: number; } /** Decodes a non-interlaced 8-bit PNG of any colour type into RGBA. */ export declare function decodePng(bytes: Uint8Array, options?: DecodePngOptions): RgbaImage; /** Encodes RGBA pixels as an 8-bit, colour-type-6 PNG. */ export declare function encodePng(image: RgbaImage): Uint8Array;