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)

Travis Coveralls

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.2: whash now also handles smaller-than-hash images

  • 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.4.tar.gz (290.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ImageHash-3.4-py3.4.egg (300.5 kB view details)

Uploaded Egg

ImageHash-3.4-py2.7.egg (299.9 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for ImageHash-3.4.tar.gz
Algorithm Hash digest
SHA256 22d5afa8089cfd08807e8133c2f03c81272e959f1dc922a2dc924c612f419841
MD5 4a1c5dd719b9bd2d3b503bdc5406811f
BLAKE2b-256 416629bf044887b419649599b8866c960dd790d0728077e89b9be4ec45288147

See more details on using hashes here.

File details

Details for the file ImageHash-3.4-py3.4.egg.

File metadata

  • Download URL: ImageHash-3.4-py3.4.egg
  • Upload date:
  • Size: 300.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ImageHash-3.4-py3.4.egg
Algorithm Hash digest
SHA256 89762abfdabd3c2cecb10189bdd5b43d11fd31bc9b1ff5a1626764fbb3c3f53f
MD5 d1775a02c9249290956ace12b605f92c
BLAKE2b-256 a1712c3f16cf2a76dc880fe2d5c1fc838dcf53d5b813dcb4ad6b32b35e314bd1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ImageHash-3.4-py2.7.egg
Algorithm Hash digest
SHA256 d427fde82d98f8ad0dceff8bdd4245e6d239a51c308e066bad26db4dad187882
MD5 07beb1bef11cb0b3cbeea939bc651175
BLAKE2b-256 9d8146c12586c2a38f9ab7e48e14764be6a32c497c0cd48db726a66b8179e75b

See more details on using hashes here.

Supported by

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