sharp-blockhash
Image perceptual hash calculation with sharp and blockhash. Used to compare similar images.
Usage:
Fully compatible with sharp
's API. Can be used in the same way of sharp
with additional blockhash
calculation.
const shash = ;const hammingDistance = ;const devNull = ;const fs = ; // input: file, output: promisePromiseall // input: file, output: stream (of the converted image data) with sharp's build-in method resize calledlet hash = ;hash;hash; { hash ;}; // input: stream, output: stream (of the converted image data) with sharp's build-in method grayscale calledhash = ;hash;fs; { hash ;}; // call with blockhash optionshash = ;//...// or;
Credit:
https://github.com/skedastik/ghash