A 12‑megapixel original JPEG and its 200‑pixel thumbnail share zero bytes. A lossless PNG and its re‑compressed WebP export are structurally unrelated at the bit level. If you rely on byte‑for‑byte matching to find duplicates, you will miss almost every copy that actually matters.
That’s why visual duplicate finders use perceptual fingerprints—hashes that stay stable under resizing, re‑compression, and mild editing. But not all perceptual hashes are equal. Some are tuned for speed. Some for colour accuracy. Some for geometric transformations like rotation and cropping. Sakarto’s image and video duplicate finder gives you seven distinct algorithms, each targeting a different kind of visual duplication problem.
This is not a generic “how‑to” guide. This is a field manual for choosing the right algorithm. And if you already know which file you’re looking for, each algorithm also has a Reverse Search counterpart—we’ll point you to both as we go.
The two families of visual deduplication
Every algorithm on this page follows the same pipeline: load the image, normalise it to a fixed canvas, extract a fingerprint, then compare fingerprints. The difference is entirely in how that fingerprint is computed.
Broadly, they split into two families:
Global hashes (Color Signature, aHash, BlockHash, dHash, pHash, wHash) produce a single compact fingerprint for the entire image. They’re fast, they scale well, and they’re excellent for detecting resized, re‑compressed, or colour‑adjusted copies. They break down when the image is rotated, cropped, or perspective‑warped—because the global structure changes too much.
Local feature matching (ORB) does the opposite. Instead of one global hash, it finds hundreds of distinctive landmarks (corners, edges, blobs) and compares their spatial arrangement. This handles rotation, cropping, and perspective distortion effortlessly—but it’s slower, and it scales poorly with very large folders.
Choosing the right algorithm is about knowing which family your problem belongs to.
The six hash algorithms: each with a specific blind spot
Sakarto’s six hash‑based algorithms look similar on the surface—they all output a binary string and compare using Hamming distance—but they encode fundamentally different visual signals.
aHash — the speed demon
aHash is the simplest and fastest option. It downsamples to 16×16, converts to grayscale, and thresholds each pixel against the overall mean brightness. That’s it. No Fourier transforms, no wavelets, no keypoints.
The result is a 256‑bit fingerprint that’s incredibly cheap to compute—under a millisecond per image. It reliably catches exact copies, resized versions, and format conversions. But it’s also the least discriminating algorithm. Two completely different images with the same average brightness distribution can produce similar hashes at loose thresholds.
Use it when: You’re scanning a massive folder and speed is your primary constraint. Start with a strict threshold and only loosen it if you need to catch more approximate matches.
Links: Find Duplicates (aHash) · Reverse Search (aHash)
pHash — the frequency‑domain workhorse
pHash takes the opposite approach. It downsamples to 32×32, applies a separable 2D Discrete Cosine Transform (the same math that underpins JPEG compression), and extracts only the low‑frequency coefficients. These low‑frequency values represent the “big picture” structure of the image—the broad shapes and tones, not the fine pixel‑level noise.
This makes pHash exceptionally stable across format conversions (JPEG → PNG → WebP), mild colour grading, and light sharpening or blurring. High‑frequency changes caused by compression or minor edits barely touch the low‑frequency band. It’s the most reliable all‑round hash for photo deduplication.
Use it when: You have a mixed collection of images from different sources—scans, exports, social media downloads. It catches the widest range of duplicates with the fewest false positives.
Links: Find Duplicates (pHash) · Reverse Search (pHash)
wHash — pHash quality, lower CPU cost
wHash uses the Haar Wavelet Transform instead of DCT. Wavelets decompose the image into multi‑scale components—low‑frequency “thumbnail” data alongside progressively finer detail. wHash extracts the lowest‑frequency 8×8 sub‑band and thresholds it against the mean.
The result is very similar to pHash in quality, but the Haar transform is computationally cheaper than DCT. wHash is the sweet spot for large collections where aHash is too crude and pHash feels slightly sluggish.
Use it when: You want pHash‑level reliability but your folder has 20,000+ images and you’d like the scan to finish faster.
Links: Find Duplicates (wHash) · Reverse Search (wHash)
dHash — the exposure‑proof gradient encoder
dHash doesn’t compare absolute brightness values. It compares the direction of brightness change between adjacent pixels. The image is resized to 17×16, converted to grayscale, and then every pair of horizontally adjacent pixels is compared: is the left pixel brighter than the right one?
This encodes horizontal brightness gradients, not absolute luminance. The key insight: an overexposed copy and a correctly exposed copy of the same scene have identical gradient patterns—the relationships between pixels are preserved even when the absolute values are very different. dHash is uniquely robust to exposure shifts and HDR‑to‑SDR conversions.
Use it when: You have multiple versions of the same photo with different exposure corrections, or you’re comparing HDR exports to their standard‑range counterparts.
Links: Find Duplicates (dHash) · Reverse Search (dHash)
BlockHash — the noise absorber
BlockHash divides a 64×64 canvas into a 4×4 grid of 16×16 blocks, averages the brightness within each block, and thresholds against the median of all blocks. The block‑level averaging absorbs JPEG compression noise, encoding artifacts, and small pixel‑level differences that would cause aHash or dHash to flag false negatives.
A heavily re‑compressed JPEG that looks nearly identical to the original will still produce matching block hashes, even if the pixel‑level data is significantly degraded.
Use it when: You’re scanning folders full of JPEGs that have been re‑saved multiple times, or images downloaded from social media platforms that apply aggressive re‑compression.
Links: Find Duplicates (BlockHash) · Reverse Search (BlockHash)
Color Signature — the one that actually sees colour
Every other hash algorithm discards colour information entirely—they convert to grayscale in the first step. Color Signature does the opposite. It divides the image into a 24×24 regional grid and measures YUV (luminance + chrominance) values in every cell.
This means two images with identical brightness structure but different colours will not match. A bright‑red photo and a bright‑green photo—which every other algorithm would treat as similar—are clearly distinguished. Conversely, two photos of the same scene that have been colour‑graded to entirely different palettes will not match here (use pHash for those).
Use it when: You want to find duplicates that share the same colour palette, such as social media re‑uploads of the same product image, or you want to group photos by visual theme rather than luminance structure.
Links: Find Duplicates (Color Signature) · Reverse Search (Color Signature)
The outlier: ORB and the geometry problem
ORB is the only algorithm on this list that doesn’t produce a global hash. Instead, it runs OpenCV.js (via WebAssembly) to detect up to 500 FAST keypoints—corners, edges, and blobs—and describes each with a 32‑byte BRIEF descriptor. Two images are compared by matching keypoints spatially using Hamming distance and Lowe’s ratio test, which filters out ambiguous matches.
This is a fundamentally different computational model. It’s not a hash; it’s a similarity measurement based on geometric consensus. ORB handles rotations, perspective distortions, cropping, and even partial occlusions—things that break every global hash algorithm. It’s also the only algorithm that genuinely supports mirrored copies (though it will identify them as distinct if you care about orientation).
The downside is performance. Keypoint matching is O(n²) in the worst case, and OpenCV.js is a large WASM payload. Sakarto loads it on demand and limits comparisons to files with similar aspect ratios, but it’s still significantly slower than any of the hash algorithms. For video files, ORB extracts 3 frames and uses the one with the most keypoints.
Use it when: You have rotated scans, cropped images, perspective‑warped photos (taken at an angle), or any geometric transformation that defeats global hashing. Avoid it for large folders where speed is the priority.
Links: Find Duplicates (ORB) · Reverse Search (ORB)
Why not just use one algorithm?
The temptation is always to pick the “best” algorithm and stick with it. That works if your duplication problem is narrow—maybe you only ever deal with re‑compressed JPEGs, or you only ever work with rotated scans. But real folders are messy. They contain exports from different cameras, social media downloads, screen captures, and scanned documents all mixed together.
Sakarto doesn’t force you to choose one. You can run a scan with pHash, review the results, then switch to ORB for a different subfolder, or use Color Signature for a separate batch of product photos. The algorithms are independent tools, not competing standards. Pick the right tool for the specific mess you’re cleaning up.
Under the hood: speed, privacy, and background processing
All image hashing runs in a Web Worker via OffscreenCanvas. This means the fingerprint extraction happens in a background thread—your browser tab stays responsive even when scanning thousands of images. Video processing is slightly different: browsers aggressively throttle background video decoding, so video frame extraction pauses when you switch tabs and resumes when you return.
Sakarto also offers Fast Mode for JPEGs (on by default). Instead of decoding the full image, it reads the embedded EXIF thumbnail (≈160×120 px). This makes JPEG scanning 5–10× faster with near‑identical accuracy for most use cases. If your JPEGs lack EXIF thumbnails, or you suspect the thumbnail doesn’t accurately represent the full image, you can disable Fast Mode.
And, of course, the privacy story holds: zero network requests after page load. No telemetry, no CDN calls for the hashing libraries (they’re bundled), no data leaving your machine.
Quick reference: all 7 algorithms at a glance
| Algorithm | Best for | Speed | Link |
|---|---|---|---|
| Color Signature | Colour‑rich photos, same palette | Fast | Find · Reverse |
| aHash | Large folders, speed priority | Fastest | Find · Reverse |
| BlockHash | Heavily compressed / artifacted copies | Very Fast | Find · Reverse |
| dHash | Exposure‑corrected / HDR variants | Very Fast | Find · Reverse |
| pHash | All‑round reliability, format conversions | Fast | Find · Reverse |
| wHash | Speed + quality balance | Fast | Find · Reverse |
| ORB | Rotated, cropped, perspective‑warped | Slower | Find · Reverse |
The verdict
Sakarto’s image and video duplicate finder isn’t a single tool—it’s a toolkit. The six hash algorithms cover the spectrum from raw speed (aHash) to frequency‑domain reliability (pHash, wHash) to colour‑aware matching (Color Signature) to geometric gradient handling (dHash) to compression‑noise absorption (BlockHash). ORB steps in for the geometry problems that hashing can’t solve.
If you’re unsure where to start: use Color Signature for colour‑rich photo libraries, pHash or wHash for mixed collections, aHash for very large folders where speed is the priority, BlockHash for heavily re‑compressed JPEG archives, dHash for brightness‑corrected versions, and ORB only for rotated, cropped, or perspective‑warped copies.
No single algorithm dominates all use cases—but the combination of all seven covers just about everything that matters.
Ready to clean up your image and video folders?
- Find Duplicates (Images & Videos) — scan a whole folder and group everything visually similar
- Reverse Search (Images & Videos) — upload one reference image and find its copies
- All Audio Duplicate Finders — if your problem is music, not photos
