# ImageHash

> open source perceptual hash library for python

**Wikidata**: [Q104870382](https://www.wikidata.org/wiki/Q104870382)  
**Source**: https://4ort.xyz/entity/imagehash

## Summary
ImageHash is an open-source software library for the Python programming language designed for perceptual hashing. It allows users to analyze and compare images based on their visual content rather than their binary data. The library is distributed as free software under the 2-clause BSD License.

## Key Facts
*   **Entity Type:** Software library / Free software.
*   **Primary Function:** Perceptual hashing.
*   **Programming Language:** Python.
*   **License:** 2-clause BSD License.
*   **Latest Recorded Version:** 4.2.0 (Released November 19, 2020).
*   **Source Code Repository:** [https://github.com/JohannesBuchner/imagehash](https://github.com/JohannesBuchner/imagehash)
*   **Software Port:** Available via MacPorts as `py-imagehash`.
*   **Copyright Status:** Copyrighted.

## FAQs
### Q: What is ImageHash used for?
A: ImageHash is a Python library used for perceptual hashing. It generates fingerprints for images that allow for comparison based on visual similarity rather than exact file matches.

### Q: Is ImageHash free to use?
A: Yes, ImageHash is classified as free software and is distributed under the 2-clause BSD License.

### Q: Where can the source code for ImageHash be found?
A: The source code is hosted on GitHub at the repository `JohannesBuchner/imagehash`.

## Why It Matters
ImageHash addresses a critical challenge in digital media management: identifying similar images even if they have different file formats, sizes, or minor edits. Standard cryptographic hashing (like MD5 or SHA-256) produces a completely different hash even if a single pixel changes, making it useless for finding visually similar content. By implementing perceptual hashing, this library enables developers to build systems for duplicate detection, copyright enforcement, and content moderation. As an open-source tool written in Python—a language in widespread use since 1991—it provides an accessible and cost-effective solution for integrating visual search capabilities into applications without relying on proprietary, black-box services. Its availability under the permissive 2-clause BSD License further encourages adoption in both open-source and commercial projects.

## Notable For
*   **Open Source Implementation:** Provides a free, accessible implementation of perceptual hashing algorithms for the Python ecosystem.
*   **Permissive Licensing:** Distributed under the 2-clause BSD License, allowing for broad commercial and private use with minimal restriction.
*   **Python Integration:** Serves the extensive Python developer community, fitting into standard workflows and package management.
*   **MacPorts Availability:** Specifically listed as `py-imagehash` in the MacPorts package management system, indicating utility in Unix-like environments.

## Body
### Technical Overview
ImageHash is a software library written in the Python programming language. Its primary utility is "perceptual hashing" (denoted as `use: perceptual hashing`). Unlike cryptographic hashes, a perceptual hash creates a fingerprint of an image's visual features. If an image is resized, compressed, or slightly altered, the hash remains similar, allowing the software to identify the image as a "near-duplicate."

### Version History and Development
The project is maintained as an open-source initiative. According to package history records, a specific version release exists with the following details:
*   **Version:** 4.2.0
*   **Release Date:** November 19, 2020
*   **Reference:** PyPI (Python Package Index)

### Licensing and Distribution
ImageHash is explicitly classified as "Free Software," defined as software distributed under terms that allow users to freely run, study, change, and distribute it. The specific legal framework is the **2-clause BSD License**. While the software is free to distribute, it maintains a "copyrighted" status, meaning the original authors retain copyright while granting the broad permissions outlined in the BSD license.

### Repository and Access
The canonical source code repository is hosted on GitHub. The project page is available in English.
*   **URL:** `https://github.com/JohannesBuchner/imagehash`
*   **MacPorts Identifier:** Users on macOS/Unix systems can install the library via MacPorts using the identifier `py-imagehash`.

## References

1. [Source](https://pypi.org/project/ImageHash/#history)