Image Processing
Perceptual Hash
A hash function that produces similar outputs for visually similar images, unlike cryptographic hashes.
What is a Perceptual Hash?
A perceptual hash (pHash) generates a fingerprint based on the visual content of an image rather than its raw bytes. Similar-looking images produce similar hashes even if the files differ in format, size, or compression.
How It Works
The image is resized, converted to grayscale, and a DCT (Discrete Cosine Transform) is applied. The resulting frequency data is reduced to a compact hash.
Applications
Perceptual hashing enables detection of re-compressed, resized, or slightly modified copies of original images — useful for copyright enforcement and copy detection.