Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distance from hash #586

Merged
merged 7 commits into from
Sep 2, 2018
Merged

Conversation

hipstersmoothie
Copy link
Collaborator

What's Changing and Why

Calculate distanceFromHash

closes #299

What else might be affected

nothing

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts
  • Add SemVer Label

@hipstersmoothie hipstersmoothie added the enhancement a request for a new feature or change in behavior label Sep 1, 2018
@edi9999
Copy link
Contributor

edi9999 commented Sep 1, 2018

I think this API could be made even more reusable by allowing to pass two arguments :

something like this :

const hash1 = image1.pHash();
const hash2 = image2.pHash();
compareHashes(hash1, hash2);

This way, if for example you have 100 images and you want to compare them "all together" to remove duplicate or similar images, you have to compute the hashes only once.

Does this make sense ?

I don't know exactly how we can expose this.

@hipstersmoothie
Copy link
Collaborator Author

@edi9999 that makes sense. I have added the compareHashes function/

@hipstersmoothie hipstersmoothie mentioned this pull request Sep 1, 2018
@edi9999 edi9999 merged commit b5e5577 into jimp-dev:master Sep 2, 2018
@hipstersmoothie hipstersmoothie deleted the distanceFromHash branch September 2, 2018 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request for a new feature or change in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support to compare image against a database of hashes?
2 participants