Project

dhash

0.05
No release in over 3 years
Low commit activity in last 3 years
Calculate Dhash on images
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0

Runtime

 Project Readme

Dhash

Dhash's (or difference hashes) are a way of calculating similarity between images. If two images have a similar dhash, then the likelihood is that they both are depicting the same image (albeit slightly cropped compressed etc).

For more information, check out the links below.

Installation

gem 'dhash'

Usage

hash1 = Dhash.calculate('face-high.jpg')
hash2 = Dhash.calculate('face-low.jpg')

if Dhash.hamming(hash1, hash2) < 10
  puts "Images are very similar"
else
  puts "No match"
end