No description
Find a file
dependabot[bot] b1476835b2
Bump form-data from 4.0.0 to 4.0.5
Bumps [form-data](https://github.com/form-data/form-data) from 4.0.0 to 4.0.5.
- [Release notes](https://github.com/form-data/form-data/releases)
- [Changelog](https://github.com/form-data/form-data/blob/master/CHANGELOG.md)
- [Commits](https://github.com/form-data/form-data/compare/v4.0.0...v4.0.5)

---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 4.0.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-01 16:56:03 +00:00
.github Create npm-publish.yml 2024-04-04 10:03:48 +02:00
src install prettier 2024-04-04 10:11:08 +02:00
test install prettier 2024-04-04 10:11:08 +02:00
.gitignore first commit 2022-03-18 16:03:06 +01:00
.mise.toml add .mise.toml 2024-04-04 10:11:17 +02:00
.npmrc first commit 2022-03-21 10:39:08 +01:00
LICENSE Create LICENSE 2022-03-21 10:46:01 +01:00
package-lock.json Bump form-data from 4.0.0 to 4.0.5 2026-03-01 16:56:03 +00:00
package.json Bump @types/node from 20.14.0 to 22.5.2 2024-09-02 05:57:24 +00:00
README.md Update README.md 2024-04-08 14:53:30 +02:00

Welcome to imgphash 👋

Version Documentation Maintenance License: MIT

Provide an image class that is able to calculate similarity to other images using the phash value

🏠 Homepage

Install

npm i imgphash

Use

This module provides a class HashImage that you can use to hash an image and compare it

  • Create a HashImage from a url
const image = await HashImage.fromUrl(url1);
  • Create a HashImage from a Node buffer
const image = new HashImage(buffer);
  • Get the hash of 2 images and compare them
const image1 = await HashImage.fromUrl(url1);
const image2 = await HashImage.fromUrl(url2);
const hash1 = await image1.phash(); // PHash instance
const hash2 = await image2.phash();
const similarity = hash1.compare(hash2);

The hash function returns an instance of PHash

  • Or just compare 2 image objects, this is going to internally calculate their hash and use it
const image1 = await HashImage.fromUrl(url1);
const image2 = await HashImage.fromUrl(url2);
const similarity = await image1.compare(image2);

All the comparisons return a value between 0 and 1. 0 meaning that the images are completely different and 1 meaning they are exactly the same image

Author

👤 Victor Martinez jaster.victor@gmail.com

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a if this project helped you!

📝 License

Copyright © 2022 Victor Martinez jaster.victor@gmail.com.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator