img-hasher
TypeScript icon, indicating that this package has built-in type declarations

0.0.13 • Public • Published

Image Hasher

A fast image hash generator and hamming distance calculator using multiple algorithms

Installation

npm install img-hasher

Usage

Get Hash Of an Image

const { getHash } = require('img-hasher');
const hash = await getHash('https://example.com/image.jpg');

Get Hash Distance Between Two Images

const { hammingDistance } = require('img-hasher');
const distance = await hammingDistance('https://example.com/image1.jpg', 'https://example.com/image2.jpg');

Get Hash Distance Between Two Hashes

const { getHash, hammingDistanceFromHash } = require('img-hasher');
const hash1 = await getHash('https://example.com/image1.jpg');
const hash2 = await getHash('https://example.com/image2.jpg');
const distance = hammingDistanceFromHash(hash1, hash2);

Algorithms

  • Mean
  • Gradient
  • VertGradient
  • DoubleGradient
  • BlockHash

Package Sidebar

Install

npm i img-hasher

Weekly Downloads

20

Version

0.0.13

License

MIT

Unpacked Size

14.2 kB

Total Files

4

Last publish

Collaborators

  • imranbarbhuiya