Skip to content

Perceptual image hashes

Algorithm atlasSimilarity

Compress selected visual statistics into a small representation for image comparison.

Try it on your image ↓

VISUAL WALKTHROUGHSimilarity
REFERENCE INPUTImage structure

A perceptual signature retains coarse appearance rather than every pixel.

RESULTCompare compact bit signatures

The displayed bits illustrate a signature, not a hash computed from this drawing. Choose the distance defined by the specific hash API.

STEP 03 / 03

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

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

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.

Input448 × 320
OutputWaiting for a result

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
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Find near-duplicate candidates or group visually related images before a more precise check.

How it works

  1. 01Normalize or transform the image according to the hash algorithm.
  2. 02Summarize low-frequency, block, colour, edge or radial structure.
  3. 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.