Perceptual image hashes
Compress selected visual statistics into a small representation for image comparison.
A perceptual signature retains coarse appearance rather than every pixel.
This pHash-style example reduces size and discards fine detail. Other hash algorithms summarize different evidence.
Low-frequency coefficients form a compact description of broad intensity structure.
The displayed bits illustrate a signature, not a hash computed from this drawing. Choose the distance defined by the specific hash API.
Compare descriptors with the algorithm’s prescribed distance.
Illustrative example. The stages explain the method; they are not a live OpenCV execution.
Try it on an image
Experiment at pixel level
Compare perceptual hashes of the input and second image. The output is the compared image; the report gives Hamming distance.
The engine loads on your first run. Your images stay in this browser.
Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.
Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Select a pixel
Select a pixel
When to use it
Find near-duplicate candidates or group visually related images before a more precise check.
How it works
- 01Normalize or transform the image according to the hash algorithm.
- 02Summarize low-frequency, block, colour, edge or radial structure.
- 03Compare descriptors with the algorithm’s prescribed distance.
image → compact visual descriptor → distance
What to tune
Choose a hash for the expected changes, then calibrate a distance threshold on representative positive and negative examples.
Where it breaks down
A perceptual hash is not a cryptographic identity and can collide. Algorithms respond differently to crops, rotation, colour shifts and overlays.
TypeScript API
Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.
All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.