/// /** * Represents the dimensions of an image (width and height) in pixels. */ export interface Dimensions { /** * The width of this image in pixels. */ width: number; /** * The height of this image in pixels. */ height: number; } /** * A diffable image with a width and a height as well as a buffer containing the data. * The data must be in RGB or RGBA format. */ export interface DiffImage extends Dimensions { /** * A node buffer containing the image information in RGB or RGBA format. */ data: Buffer; } /** * The result of diffing two images. */ export interface DiffResult { /** * The amount of pixels that didn't match. */ pixels: number; /** * The output image visually representing the difference between two images. */ image?: DiffImage; /** * A relative number which grows from `0` the higher the total difference between both images was. * This also takes the color differences between individual pixels into account. */ totalDelta: number; } export interface DiffImagesArguments { /** * The first image to compare. */ image1: DiffImage; /** * The second image to compare. */ image2: DiffImage; /** * A threshold of perceived color difference between two pixels. Ranging from `0` to `1` * with `0` being the most sensitive and `1` ignoring basically any difference between two pixels. * This threshold is applied to each pixel. Defaults to `0.1`. */ colorThreshold?: number; /** * Whether to attempt to detect antialiasing when comparing the images. Defaults to `true`. */ detectAntialiasing?: boolean; /** * If set to `false` no image visualizing the difference is generated. */ generateDiffImage?: boolean; } export declare function diffImages(args: DiffImagesArguments): DiffResult; export declare function diffImages(image1: DiffImage, image2: DiffImage): DiffResult;