perceptual

A library for computing and comparing perceptual hashes in Nim


Keywords
perceptual, hashes, images
License
MIT
Install
nimble install perceptual

Documentation

perceptual

This is a small library for computing perceptual image hashes. Those hashes allow quickly finding duplicating images.

Currently, there's 5 different hashes implemented here:

In the future SIFT/SURF feature extraction can be added to the library. This should allow the most precise image matching. However it will also be the slowest one.

API Reference

Installation

nimble install perceptual

Example

import perceptual

let hash1 = dhash("image1.jpg")
let hash2 = dhash("image2.jpg")

let difference = diff(hash1, hash2)

echo "Image Difference: ", difference
if difference < 15:
  echo "Probably the same image!"
elif difference < 25:
  echo "Can be similar"
else:
  echo "Different"