Skip to main content

Image Hashing library

Project description

A image hashing library written in Python. ImageHash supports:

  • average hashing (aHash)

  • perception hashing (pHash)

  • difference hashing (dHash)

  • wavelet hashing (wHash)

Requirements

Based on PIL/Pillow Image, numpy and scipy.fftpack (for pHash) Easy installation through pypi.

Basic usage

>>> from PIL import Image
>>> import imagehash
>>> hash = imagehash.average_hash(Image.open('test.png'))
>>> print(hash)
d879f8f89b1bbf
>>> otherhash = imagehash.average_hash(Image.open('other.bmp'))
>>> print(otherhash)
ffff3720200ffff
>>> print(hash == otherhash)
False
>>> print(hash - otherhash)
36

The demo script find_similar_images illustrates how to find similar images in a directory.

Source hosted at github: https://github.com/JohannesBuchner/imagehash

Changelog

  • 3.0: dhash had a bug: It computed pixel differences vertically, not horizontally.

    I modified it to follow dHash. The old function is available as dhash_vertical.

  • 2.0: added whash

  • 1.0: initial ahash, dhash, phash implementations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ImageHash-3.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

ImageHash-3.0-py2.7.egg (8.3 kB view details)

Uploaded Egg

File details

Details for the file ImageHash-3.0.tar.gz.

File metadata

  • Download URL: ImageHash-3.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ImageHash-3.0.tar.gz
Algorithm Hash digest
SHA256 31d8474ffa3201279f758cef7db24eeef1b488b54b4f4be6a2d6b74a233716b4
MD5 e509d748cb6f0b27a056ef903de01b0e
BLAKE2b-256 c8d047d1ce7350ece1ff759c5d399392172435391da1ab1008a77c533f59e7e0

See more details on using hashes here.

File details

Details for the file ImageHash-3.0-py2.7.egg.

File metadata

  • Download URL: ImageHash-3.0-py2.7.egg
  • Upload date:
  • Size: 8.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ImageHash-3.0-py2.7.egg
Algorithm Hash digest
SHA256 0d1da87a214593b754d0fbaf3a0ce726a569c2e8a78dcbd62c4f23f0329ed608
MD5 eb95068adbcb5db55b47a57066f192bf
BLAKE2b-256 deab64dbe89ea9975f6707501983b921cd014d6f88c3afa762cc04913572f7c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page