Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imranbarbhuiya/img-hasher
A fast image hash distance canculation library for nodejs
https://github.com/imranbarbhuiya/img-hasher
Last synced: about 5 hours ago
JSON representation
A fast image hash distance canculation library for nodejs
- Host: GitHub
- URL: https://github.com/imranbarbhuiya/img-hasher
- Owner: imranbarbhuiya
- Created: 2023-05-14T02:09:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-05T05:02:59.000Z (10 days ago)
- Last Synced: 2024-11-05T06:17:39.342Z (10 days ago)
- Language: Rust
- Size: 8.58 MB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Image Hasher
A fast image hash generator and hamming distance calculator using multiple algorithms
## Installation
```bash
npm install img-hasher
```## Usage
### Get Hash Of an Image
```js
const { getHash } = require('img-hasher');
const hash = await getHash('https://example.com/image.jpg');
```### Get Hash Distance Between Two Images
```js
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
```js
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