Perceptual GIF hashing for easily finding near-duplicate GIFs.
- Install a recent version of imagemagick >=
brew install imagemagickon Mac OS).
npm install --save phash-gif
const pHashGIF =const hash1 = await pHashGIFconst hash2 = await pHashGIFconst diff = await pHashGIF
Computes a perceptual hash of the given GIF.
For animated gifs, the result will be an array of 126 floating point values, corresponding to the three image hashes of the first, middle, and last frames of the input gif.
For static gifs, the result will be an array of 42 floating point values, the same as returned by phash-im.
Path to a GIF file.
Computes the L2 norm of the two hashes returnd by
phash.compute (sum of squared differences).
Perceptual hash of first image.
Perceptual hash of second image.
- phash-im - Perceptual image hashing provided by imagemagick.
- pHash - A popular open source perceptual hash library.
MIT © Travis Fischer