# Image Hash and Similarity

Compute perceptual hashes (pHash, dHash and aHash) of an image, or upload two images to see how similar they are. Perceptual hashes stay nearly the same when an image is resized, recompressed or slightly edited, which makes them useful for finding duplicates.

## Frequently asked questions

### What is a perceptual hash?

A short fingerprint of what an image looks like, not of its bytes. Unlike a cryptographic hash, similar images get similar hashes, so a resized or recompressed copy can still be recognized.

### What is the difference between pHash, dHash and aHash?

aHash compares each pixel of an 8 by 8 thumbnail with the average brightness. dHash compares neighbouring pixels, which captures gradients. pHash uses a discrete cosine transform of a 32 by 32 thumbnail and is the most robust against small changes.

### How is similarity measured?

By the Hamming distance, the number of the 64 bits that differ between two hashes. 0 means identical hashes; the tool calls distances up to 5 the same image and up to 12 similar, based on pHash.

### Can the hashes be compared with other tools?

The algorithms are standard, but libraries differ in resizing and rounding details, so hashes from different implementations may not match bit for bit. Compare hashes made with the same tool.

### Does it detect cropped or rotated copies?

Not reliably. Perceptual hashes handle scaling, compression and colour changes well, but cropping and rotation change the hash a lot.

### How many images can I upload?

One to get its hashes, or two to compare them.

Your ad here?

[Email us](mailto:hi@dennn.is?subject=Advertising%20on%20OneClick%20Pro)

[Ad 433 tools for your AI agents through one MCP server.](https://multitaskai.com/?ref=oneclickpro)
