Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 502 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 502 Bytes

phash Coverage ci.yml

A simple perceptual hashing library in Go.

Usage :

f, err := os.Open("image.jpg")
if err != nil {
    panic(err)
}
defer f.Close()
img, _, err := image.Decode(f)
if err != nil {
    panic(err)
}
hash1 := phash.DTC(img)
hash2 := phash.DTC(img)

if phash.Distance(hash1, hash2) == 0 {
    fmt.Println("these images sure do look alike.")
}