/** * `@variance-authority/png/difference` — the codec half of known-difference * measurement. * * **Requires a PNG codec**, and that is the only reason it is not in * `@variance-authority/raster/difference` with the rest. Decoding is the one step * that needs somebody's decoder; the field, the curve, the deltas and the * artifact are arithmetic over two arrays and cost nothing, so they live where a * caller who already has decoded pixels can reach them without installing this. * * The split has a practical consequence worth stating: a team whose images arrive * as raw RGBA — from a canvas, a WASM renderer, a framebuffer — never installs * `pngjs` at all. */ import { type DifferenceObservation, type DifferenceMetric, type ImageNormalizationOptions, type NormalizedImage } from '@variance-authority/raster/difference'; /** * Decode a PNG into the RGBA the metrics consume. * * `alphaMode` is reported as `straight` whenever the image carries a non-opaque * pixel and `opaque` otherwise, because the distinction changes what a metric * does and guessing it wrong is silent. Nothing is resampled, converted or * colour-managed: `colorSpace` is declared, not detected, for the same reason the * rest of the package refuses to align — a conversion this library performs is a * difference this library invented. */ export declare function decodeImage(bytes: Buffer, colorSpace?: string): NormalizedImage; export interface ObservePngDifferenceInput { readonly firstImage: Buffer; readonly secondImage: Buffer; readonly metric: DifferenceMetric; readonly severityLevels: readonly number[]; readonly normalization?: ImageNormalizationOptions; /** Declared, never sniffed. Both images must agree. */ readonly colorSpace?: string; } /** * Observe the difference between two PNGs. * * The source hashes are taken over the **encoded** bytes rather than the decoded * pixels, because that is what the caller actually has and can look up again. */ export declare function observePngDifference(input: ObservePngDifferenceInput): Promise; //# sourceMappingURL=difference.d.ts.map