import { Rect } from '../../types'; /** * Generates an image from two binarized images where black pixels are where * `compare` is black and `base` is not. This is useful for determining where a * white-background form was filled out, for example. * * Note that the sizes of the bounds, which default to the full image size, must * be equal. * * ``` * BASE COMPARE DIFF * ┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐ * │ │ │ █ █ ███ │ │ █ █ ███ │ * │ █ █ │ │ █ █ ███ █ │ │ ███ █ │ * │ █ │ │ █ █ █ ███ │ │ █ █ ███ │ * │ █ █ █████████████ │ │ █ █ █████████████ │ │ │ * └───────────────────┘ └───────────────────┘ └───────────────────┘ * ``` */ export default function diff(base: ImageData, compare: ImageData, baseBounds?: Rect, compareBounds?: Rect): ImageData; export interface CountOptions { color?: number; bounds?: Rect; } /** * Determines the ratio of black (or custom color) pixels in an image to the * total number of pixels. */ export declare function ratio(image: ImageData, options?: CountOptions): number; /** * Determines number of black (or custom color) pixels in an image. */ export declare function countPixels(image: ImageData, { color, bounds, }?: CountOptions): number;