A Python library for calculating difference hash (perceptual hash) for images, useful for detecting near-duplicates. Version 1.4 is stable but sees minimal maintenance; last updated in 2021. Release cadence is low.
pip install dhashNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Loads an image and computes its 64-bit difference hash as an integer.
Use Image.open(path) to get a PIL Image object before calling dhash.
Use format(hash, '016x') to get a hex string representation.
Consider using imagehash library if active maintenance is desired.
Use dhash.dhash_int(image) instead.
Open the image with Image.open() and pass that object.