I need to check for similar images in our Java server (backend, 1.8, spring). We will have lot of images, so finding similar ones one by one is not an option. I need to use some kind of Hashing algorithm, like Magic or pHash, but I could not find any Java library or framework that would implement anything like this and not abandoned.

Is there any library or framework for similar image finding, perceptual hashing?

2 Answers 2


This pHash alternatives discussion leads to:

The top one looks recently active.

Further, this post on detecting somewhat different images (Java) points to a longer list, including:

See also more general discussions:

  • Your links prove, that as of today, there no maintained or up to date Java implementation of pHash or similar. I ended up working with my own implementation, based of the various examples and code snippets I could find.
    – szabkel
    May 28, 2018 at 5:56
  • Good luck! If you are creating an up-to-date implementation in Java, please consider sharing it in a public repository to help others with similar problems in the future. May 28, 2018 at 5:59

Another alternative: https://github.com/KilianB/JImageHash . Looks fairly active and PerceptiveHash class allows to specify the output hash size.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.