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.1.tar.gz (290.2 kB view details)

Uploaded Source

Built Distribution

ImageHash-3.1-py2.7.egg (298.7 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for ImageHash-3.1.tar.gz
Algorithm Hash digest
SHA256 ef6d2d9a8160dff57c2551dfea48b9437d3d674fcb4eaf39623be41c0672dc20
MD5 0bf909b6d138768f80dd689be7bedaaa
BLAKE2b-256 0c1cb6f539cc08cf8cfb12cb59a6883ee7f1cc0937cf3709247c2a15c8a1e665

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ImageHash-3.1-py2.7.egg
Algorithm Hash digest
SHA256 9a4376a0024e44f4178af03ec9fe73e0c1990b14aebdd12616375d43586daa55
MD5 4e6c5ec2eebcf24e75f6f2bea3ced991
BLAKE2b-256 6482d3a3d08a4a2d8f86e63a4f7d60caab73e39e66c6f96f31224fc095ed7209

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