UNPKG

@alttiri/image-hash

Version:

Alt-Image-Hash. An alternative image hashing library.

21 lines (20 loc) 1.22 kB
import { BiImageData, GrayImageData } from "./mono-image-data.js"; export declare function dHashCore({ data, width, height }: GrayImageData): BiImageData; export declare function aHashCore({ data, width, height }: GrayImageData): BiImageData; export declare function _mHashCoreClassic(data: Uint8Array, width: number, height: number): Uint8Array; export declare function mHashCoreClassic({ data, width, height }: GrayImageData): BiImageData; export declare function mHashCore({ data, width, height }: GrayImageData): BiImageData; /** * Two conditions for the proper handling of images with extreme median values (~0 or ~255). Do not edit. * * On dark images the median value will be a black pixel. * On light images the median value will be a white pixel. * * So, it prefers to display the light details on dark images and vice versa. * * Check the "big" hashes for the follow images: * - `black-bg-orthocanna-500x500` * - `screenshot-dark-purple-flower-1353x851` (look at the text on the screenshot) */ export declare function _mHashCore(data: Uint8Array, width: number, height: number): Uint8Array; export declare function bHashCore({ data, width, height }: GrayImageData, bandCount?: number): BiImageData;