What is a perceptual hash?

perceptual hash n. a fingerprint of an audio, video or image file that is mathematically based on the audio or visual content contained within. Unlike cryptographic hash functions which rely on the avalanche effect of small changes in input leading to drastic changes in the output, perceptual hashes are "close" to one another if the inputs are visually or auditorily similar.

Cutting edge technology

Perceptual hashes must be flexible enough to take into account transformations that could have been performed on the input, such as rotation, skew, altering contrast, etc., yet be robust enough to distinguish between visually or auditorily dissimilar inputs. All of these properties equate to perceptual hashes being an interesting field of study and at the forefront of computer science research.

What is pHash?

pHash is an open source software library released under the GPLv3 license that implements several perceptual hashing algorithms, and provides a C++ API to use those functions in your own programs.

pHash 0.3 Released

11.03.2008. Major feature enhancements. Tweaked pixel tube algorithm, now supports images and preliminary support for videos, and added RADISH algorithm for images. Many bug fixes. Download.

That's great but what is it good for?

Perceptual hashes have applications in searching, identifying potential copyright infringement, entertainment and surely more. Since a fingerprint of a file is usually less than 1% of the original media file's size, the fingerprint can be stored in a database and used for semantic searching, such as finding all pictures that look like the one I have. They can also be used to identify duplicate content, or even content that is owned by someone else. For example, YouTube could maintain a database of hashes that have been submitted by the major movie producers of movies to which they hold the copyright. If a user then uploads the same video to YouTube, the hash will be almost identical, and it can be flagged as a possible copyright violation. It could also be the technology behind a service whereby you call a number and sing a tune and based on the hash computed from your singing, name the tune.