--- id: imagehash version: "4.3.2" license: 2-clause BSD License license_treatment: permissive maintenance: aging --- # ImageHash — Image Hashing library License: permissive · Maintenance: aging · Downloads: 6.0M/mo ## What it is and what it does ImageHash is a Python library that generates perceptual hashes from images—compact fingerprints that remain similar when images are visually alike but differ in compression, scaling, or minor edits. Unlike cryptographic hashes (MD5, SHA-1), where tiny changes produce completely different outputs, perceptual hashes are designed so that similar images produce similar hashes, measurable by Hamming distance. The library supports six hashing strategies: average hashing, perceptual hashing, difference hashing, wavelet hashing, HSV color hashing, and crop-resistant hashing. Each can be tuned for sensitivity by adjusting hash size or other parameters. The package is built on pillow for image handling, numpy for numerical operations, scipy for Fourier transforms, and PyWavelets for wavelet analysis. It's commonly used to find duplicate or near-duplicate images in collections, implement reverse image search, detect manipulated images, and deduplicate media libraries. Hashes can be stored as hex strings, persisted in databases, and compared using fast Hamming distance queries. Use it for: - Deduplicate image libraries by computing hashes and finding images with Hamming distance below a threshold - Build reverse image search by storing hashes in a database and querying for visually similar images - Detect near-duplicate user uploads in content moderation or social media platforms - Find cropped or slightly modified versions of images using crop-resistant hashing - Analyze color distribution similarity between images using colorhash for palette-based matching ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. ImageHash computes perceptual fingerprints of images using multiple hashing algorithms, allowing you to detect visually similar images even when they differ in compression, size, or minor edits. Yes. ImageHash is mature, well-maintained, permissive-licensed, and has no known vulnerabilities. Install friction is low and it solves a specific, well-defined problem. Use it if you need to detect visually similar images; skip it if you only need exact image matching or cryptographic integrity checking. ## Install pip install imagehash uv add imagehash poetry add imagehash ## Installing ImageHash Before you install: Low friction: pure Python wheel with four well-established scientific dependencies (numpy, scipy, pillow, PyWavelets). Last release was 2025-02-01; repository shows active maintenance with 3860 stars, though the package is aging (559 days since last release). License in practice: 2-clause BSD License is permissive; you can use, modify, and redistribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install imagehash import imagehash import pillow hash1 = imagehash.average_hash(image1) hash2 = imagehash.average_hash(image2) if hash1 == hash2: print('Images are similar') Verify before relying: - Whether the package supports modern Python versions (requires_python is unspecified in metadata) - Performance characteristics when hashing large image collections or very high-resolution images - How to load images into the format expected by the hashing functions ## Package facts - License: 2-clause BSD License (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 6.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags image similarity detection, perceptual image hashing, find duplicate images, image fingerprinting, visual image comparison, hamming distance image search, crop-resistant image hash, image-processing, similarity-detection, computer-vision [View on SkillFed](https://skillfed.io/packages/imagehash) · [View on PyPI](https://pypi.org/project/imagehash/)