Skip to content

Instantly share code, notes, and snippets.

@dmpetrov
Created March 6, 2017 04:32
Show Gist options
  • Save dmpetrov/0b7c78b0af187f4f7e49e3772e054d28 to your computer and use it in GitHub Desktop.
Save dmpetrov/0b7c78b0af187f4f7e49e3772e054d28 to your computer and use it in GitHub Desktop.
Perceptual image hashes difference for Lenna images
# Code for the blogpost https://fullstackml.com/2016/07/02/wavelet-image-hash-in-python/
import PIL
from PIL import Image
import imagehash
lenna = PIL.Image.open(‘lenna.png’)
lenna1 = PIL.Image.open(‘lenna1.jpg’)
h = imagehash.phash(lenna)
h1 = imagehash.phash(lenna1)
h-h1
# > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment