The duplicate finder is great when you don’t know what you’re looking for. It scans a folder and automatically groups everything similar. But what if you already know exactly which file you want copies of?
That’s where Reverse Image Search comes in. Instead of grouping everything, you upload one reference file first. Sakarto processes it immediately, then scans your chosen folder and returns only the files that look like that specific reference. The reference is pinned at the top with a protected badge—it can never be accidentally moved or deleted.
With the dHash (Difference Hash) algorithm, it finds copies of your reference even when they’ve been brightness‑adjusted, exposure‑corrected, or colour‑graded. Instead of comparing absolute brightness values, dHash compares the direction of brightness change between adjacent pixels. When you brighten or darken an image uniformly, the relative ordering of pixel brightness stays almost entirely the same. A brightened copy and the original produce nearly identical dHashes.
What makes dHash reverse search different from aHash or pHash?
All three algorithms produce a binary hash and compare using Hamming distance. But they encode fundamentally different visual properties:
| aHash | pHash | dHash | |
|---|---|---|---|
| What it encodes | Average brightness per pixel | Low‑frequency frequency content | Direction of brightness change |
| Sensitive to | Overall brightness level | Fine edits, watermarking | Exposure, brightness shifts |
| Best for | Speed, exact copies | Format conversions, precision | Exposure‑adjusted, colour‑graded copies |
The key insight: dHash never compares absolute values. It only records the relative ordering—which pixel is brighter than its neighbour. This makes it virtually immune to uniform brightness changes, contrast adjustments, gamma corrections, and the global tone mapping used in HDR processing.
How reverse search works
The standard Find Duplicate Images & Videos workflow scans a folder and compares every file against every other file. That’s O(n²) complexity—fine for a few hundred images, but it gets slower as the folder grows.
Reverse Search does something much smarter. It fingerprints your reference once, then compares each folder file only against that reference. That’s O(n) complexity—linear scaling. A folder of 10,000 images takes roughly the same time per file as a folder of 100. The scan speed depends only on the number of files, not how many of them are similar to each other.
This makes reverse search the faster choice for large folders where you already know what you’re looking for.
The reference protection system
The reference file is treated differently from every other file in the scan. When you upload it, Sakarto immediately:
- Computes its fingerprint using dHash
- Shows a thumbnail preview so you can confirm the right file was loaded
- Pins it at the top of the results as soon as scanning starts
- Displays a blue REFERENCE badge on the card
- Prevents it from being moved or deleted—Move and Delete buttons are disabled on the reference card
This last point is critical. If you’re using reverse search to find copies of a file you want to keep, you don’t want to accidentally delete the original. The reference protection system makes that impossible.
How the dHash algorithm works
The dHash algorithm follows a straightforward pipeline. Here’s exactly what happens when you run a reverse search:
Step 1: Process the reference file immediately
When you upload your reference file, Sakarto processes it right away—before you even select the folder to search. The image is resized to 17×16 pixels (one pixel wider than tall), converted to grayscale, and its 256-bit gradient hash is computed. The reference card appears immediately with a blue REFERENCE badge, confirming that your file is loaded and ready.
Step 2: Resize each folder file to 17×16
For each image in the scanned folder, Sakarto draws it onto a 17×16 canvas. The extra column is what makes the horizontal gradient comparison possible: every pixel in the 16 columns has one neighbour to its right. In Fast Mode, JPEG files use their embedded EXIF thumbnail instead of the full image, making scans 5–10× faster.
Step 3: Convert to grayscale and compare adjacent pixels
Each of the 17×16 = 272 pixels is converted to a single brightness value using the standard luminance formula. Then, for each row, each pixel is compared to the pixel directly to its right. If the left pixel is brighter than its right neighbour, the bit is 1. If it is darker or equal, the bit is 0.
Step 4: Produce the 256-bit gradient hash
Reading across all 16 rows, each with 16 comparisons, produces a 256-bit binary fingerprint. This hash encodes the direction of brightness change at 256 positions across the image—a compact map of the image’s edge and gradient structure.
Why this works for brightness shifts: When you uniformly increase brightness, every pixel gets brighter by roughly the same amount. The left pixel and the right pixel both shift up proportionally. The relative ordering is preserved. dHash records this ordering—so a brighter or darker version of the same image produces an identical or near‑identical hash.
Step 5: Compare against the reference using Hamming distance
To compare a folder file against your reference, Sakarto XORs their 256-bit hashes bit by bit. The number of positions where the bits differ is the Hamming distance. An aspect-ratio pre-check first discards pairs where proportions differ by more than 10%. If the Hamming distance is at or below the threshold, the file is added to the results.
Step 6: Reference pinned first, matches rendered live
The reference card always appears at position 0 with a blue REFERENCE badge. Each matching file is rendered as a card immediately when found—you see results appear live without waiting for the full scan.
What dHash reverse search finds well
| Type of copy | How well it works | Why |
|---|---|---|
| Exact copies of your reference | ✅ Excellent | The hash will be identical. |
| Reference saved at different resolutions | ✅ Excellent | Resizing to 17×16 removes resolution differences. |
| Brightness‑adjusted or exposure‑corrected copies | ✅ Excellent | The relative ordering of pixel brightness is preserved under uniform brightness changes. |
| HDR vs standard versions of the same scene | ✅ Very Good | Global tone mapping preserves most gradient directions. |
| Contrast‑tweaked versions | ✅ Good | Contrast changes alter the magnitude of gradients but usually preserve direction. |
| Lightly colour‑graded copies | ✅ Good | As long as the grading doesn’t shift where edges appear. dHash operates in grayscale, so hue shifts don’t affect it. |
| Re‑compressed JPEG versions | ✅ Good | Compression artifacts may affect some bits but dHash remains stable. |
| Screenshots of the reference image | ✅ Very Good | Screenshots preserve gradient structure. |
| Videos sharing key visual scenes with the reference | ✅ Good | Video frames are averaged. |
| Heavily cropped copies (over 30% removed) | ⚠️ May miss | Cropping shifts the position of edges in the grid. |
| Rotated or mirrored copies | ❌ Won’t find | Rotation transposes horizontal gradients to vertical, mirroring reverses direction. Use ORB. |
| Images with heavy filtering that eliminates gradients | ⚠️ May miss | Strong posterization or blur can flatten gradients. |
| Completely different scenes with similar compositional lines | ⚠️ May over‑match | dHash encodes composition, not content—two shots with similar edge structure can match. |
Understanding the Hamming threshold slider
The threshold slider determines how strictly a folder file must match your reference to be considered a copy. Lower values = stricter matching.
| Threshold range | What it does | When to use |
|---|---|---|
| 0–5 (Very strict) | Only near-identical gradient patterns match. False positives are very rare. | Finding exact copies and very close re-exports of your reference. |
| 6–15 (Balanced) | Catches resized, re-compressed, brightness‑adjusted, and lightly colour‑graded copies. | Default and recommended. dHash at 10–15 often catches exposure variants that other algorithms miss. |
| 16–25 (Loose) | Includes more approximate gradient matches. More false positives. | If you’re missing copies that have significant edits or different compositions. |
| 30+ (Very loose) | Groups images with broadly similar gradient structure. | Only use for exploration. Expect many false positives—always preview before acting. |
Tip: Because dHash is insensitive to brightness, you may find that it catches exposure‑corrected copies at a lower threshold than you’d use with aHash. Start at 8–10 and raise only if needed.
How to use dHash reverse search: step by step
Step 1: Select your reference file
Click Choose Reference File in the left panel. Select any image or video from your computer. A preview appears immediately so you can confirm you picked the right file. Sakarto processes the reference file right away—computing its hash before you even select the folder. This means the search starts instantly once you pick a folder.
Tip: The reference file does not need to be inside the folder you’re about to scan. It can be from anywhere on your computer.
Step 2: Select the folder to search
Once a reference file is loaded, the Choose Folder to Search button becomes active. Click it to open a native folder picker (Chrome/Edge). Or drag and drop a folder onto the page. The folder count shows how many files were found. The Start Search button activates once both the reference file and a folder are selected.
Tip: Enable Fast Mode in the toolbar if you’re scanning many JPEG files—it reads embedded thumbnails and is 5–10× faster than loading full images.
Step 3: Start the search
Click 🔍 Start Search. The reference file card appears immediately at the top of the results with a blue REFERENCE badge. A progress bar shows how many files have been scanned. You can switch browser tabs during the search—image processing runs in a background Web Worker and continues uninterrupted. Video processing pauses when the tab is hidden and resumes when you return.
Step 4: Adjust the threshold if needed
Use the Similarity Threshold slider to tune matching sensitivity. Releasing the slider triggers an instant re-search using already-computed hashes—no re-scan needed. If expected copies are missing, raise the threshold. If too many unrelated files appear, lower it.
Step 5: Review matches as they appear
Every time a matching file is found, it appears as a new card next to the reference. The header count updates live. Once the scan finishes, a final summary shows the total number of similar files found.
- Click a card to select it (blue border)
- Ctrl+Click (Cmd+Click on Mac) to add to the compare list (purple border)
- Click the 🔍 icon on hover to preview full size with metadata
- Right‑click any card for the context menu (the reference card has Move/Delete grayed out)
- Click & drag on empty space to box‑select multiple result cards
Step 6: Compare reference vs. match side‑by‑side
Ctrl+Click the reference card and one or more match cards, then click ⚖️ Compare in the toolbar. A modal opens showing all selected files side‑by‑side with their dimensions, file size, path, and a similarity percentage. For 3+ files, a full pairwise similarity matrix is shown. Similarity percentages above 80% are shown in green, 50–80% in amber, and below 50% in red—giving you a quick visual indicator of how close each match is to your reference.
Step 7: Act on matches—Move, Delete, or Copy
Select the files you want to act on (not the reference—it’s protected) and use the toolbar. With Queue Mode on (recommended), files are staged first:
- 📋 Copy — copy filename(s) to clipboard
- 📂 Move — stage matches for move to a named folder
- 🗑️ Delete — stage matches for permanent deletion
- ⚖️ Compare — view selected files side‑by‑side
Warning: Deletions are permanent. The File System Access API bypasses the recycle bin. Always use Queue Mode to review before executing. The reference file cannot be deleted or moved.
Step 8: Queue Mode—review before you commit
When Queue Mode is enabled (the default), clicking Move or Delete stages files rather than acting immediately. Switch to the Move Queue or Delete Queue tab in the sidebar to review what’s staged, remove individual files, then execute when ready.
Reverse Search vs. Find Duplicates: which to use?
| Reverse Search | Find Duplicates | |
|---|---|---|
| What it does | Finds copies of one specific reference file | Groups all similar files in a folder |
| Complexity | O(n) — each file compared against reference | O(n²) — all files compared against each other |
| Speed | Faster for large folders | Slower for large folders |
| Reference protection | Yes — reference pinned and cannot be deleted | No — all files are treated equally |
| Best for | You know exactly which file you’re looking for | You want to see every duplicate group in a folder |
| When to use | ”I need to find every copy of this specific photo" | "I need to clean up my entire photo library” |
Recommendation: Use both. Run Find Duplicates to see the big picture. Then use Reverse Search for specific important files to clean up their copies without risking the originals.
When to use dHash vs. the other 6 algorithms for reverse search
Sakarto gives you seven visual algorithms for a reason—each one handles a different type of duplication problem. Here’s when to pick dHash over the others:
Color Signature — colour accuracy
Color Signature is the only algorithm that compares actual colour.
Use dHash instead: Your reference’s copies have been brightness‑adjusted or colour‑graded in ways that shift colour. Color Signature would see the colour differences as mismatches; dHash ignores colour and focuses on gradient structure, which remains stable.
aHash (Average Hash) — speed above all else
aHash is the fastest algorithm—it reads individual pixels and compares them to the overall mean.
Use dHash instead: Your reference’s copies have been brightened, darkened, or exposure‑corrected. aHash’s mean‑based comparison is sensitive to overall brightness levels; dHash’s gradient‑based comparison is not.
BlockHash — noise tolerance
BlockHash averages brightness over blocks, making it tolerant of compression noise.
Use dHash instead: Your reference’s copies are clean but have exposure variations. BlockHash is more tolerant of noise but less sensitive to the fine gradient structure that dHash captures.
pHash (Perceptual Hash) — format conversions and watermarks
pHash uses the Discrete Cosine Transform to extract low‑frequency structural data. It’s more discriminating than dHash but slower.
Use dHash instead: You need speed and your copies are brightness‑adjusted. pHash is more sensitive to global brightness changes than dHash—it encodes frequency coefficients that shift with brightness.
wHash (Wavelet Hash) — speed and quality balance
wHash uses the Haar Wavelet Transform—similar quality to pHash at lower CPU cost.
Use dHash instead: You specifically want to ignore brightness shifts. wHash still encodes absolute brightness values through its wavelet coefficients; dHash deliberately discards them.
ORB (Feature Matching) — rotation, cropping, and perspective
ORB is the only algorithm that handles rotation, cropping, and perspective warping.
Use dHash instead: Your copies are not rotated or heavily cropped. dHash is 100× faster than ORB for large folders and handles brightness shifts better.
Algorithm quick reference for reverse search
| Algorithm | Best for | Colour‑aware? | Handles rotation? | Handles brightness shifts? | Speed |
|---|---|---|---|---|---|
| Color Signature | Same colour palette, social media re‑uploads | ✅ Yes | ❌ No | ⚠️ Moderate | Fast |
| aHash | Large folders, speed priority | ❌ No | ❌ No | ⚠️ Moderate | Fastest |
| BlockHash | Heavily compressed JPEGs, noisy images | ❌ No | ❌ No | ⚠️ Moderate | Very Fast |
| dHash | Brightness/exposure‑adjusted copies | ❌ No | ❌ No | ✅ Excellent | Very Fast |
| pHash | Format conversions, watermarks, precision | ❌ No | ❌ No | ⚠️ Moderate | Fast |
| wHash | Speed + quality balance | ❌ No | ❌ No | ⚠️ Moderate | Fast |
| ORB | Rotated, cropped, perspective‑warped | ❌ No | ✅ Yes | ✅ Good | Slower |
Privacy: your files never leave your device
Like every Sakarto tool, the reverse image search runs entirely in your browser:
- Zero network activity after page load. Open DevTools → Network tab and verify: no outbound requests during any search, compare, or file operation. Your reference file and folder contents are never transmitted anywhere.
- No accounts, no cookies, no analytics. The only localStorage data is your OS detection and checkbox preferences. No file names, paths, or scan results are ever saved.
- Folder access is scoped and session‑only. Permission is granted only for the specific folder you select, lasts only while the tab is open, and is revocable at any time from browser site settings.
- Purely static—no backend. Sakarto is HTML, CSS, and JavaScript. There is no server, no database, and no API receiving any data from you.
Frequently asked questions (dHash reverse search specific)
“Why is dHash specifically better at finding brightness‑adjusted copies than aHash or pHash?”
When you uniformly brighten or darken an image, every pixel value shifts by a similar amount. aHash compares each pixel to the overall mean brightness—if brightness shifts, the mean shifts too, but individual pixels near the mean can flip sides (from above‑average to below‑average or vice versa), changing hash bits. pHash encodes DCT coefficients which are similarly affected by absolute value changes. dHash encodes the direction of brightness change between adjacent pixel pairs: is the left pixel brighter or darker than the right one? A uniform brightness shift doesn’t change which pixel is brighter than its neighbour—it only changes both values by the same amount, preserving their relative ordering. This is why dHash is uniquely robust to exposure, gamma, and brightness corrections that affect the absolute tone of the image without changing its local gradient structure.
”Does my reference file need to be inside the folder I’m scanning?”
No—select it from anywhere on your computer. If it exists inside the scanned folder, Sakarto skips it automatically (matched by filename, file size, and last‑modified timestamp). The reference is always pinned at position 0 and protected from deletion regardless of what’s in the folder.
”A brightness‑corrected copy of my reference isn’t appearing. What should I try?”
First, raise the threshold toward 15–20. If the exposure adjustment was very extreme—clipping highlights to pure white, crushing shadows to pure black, or inverting the image—local brightness relationships between adjacent pixels may have been reversed, flipping those gradient bits. A higher threshold accommodates this. If the copy was also cropped or rotated on top of the brightness change, dHash cannot match it at any threshold—try ORB Reverse Image Search for geometric transformations. Also verify both files have similar aspect ratios: the pre‑check excludes pairs differing by more than 10%.
”Can dHash find colour‑graded copies where colours have been shifted but structure is preserved?”
Yes—this is dHash’s second major strength after brightness tolerance. Colour grading changes hues and saturation, but the luminance gradient structure (which regions are brighter or darker than their neighbours) is usually preserved. dHash operates in grayscale, so hue shifts don’t affect it at all. A portrait with warm vs. cool colour grading, an Instagram‑filtered version of a photo, or a cross‑processed scan will typically match the original at the default threshold. For very heavy colour grading that also dramatically shifts luminance relationships, try raising the threshold slightly.
”I’m getting too many unrelated matches. How do I reduce false positives?”
Lower the threshold slider to 4–8. dHash encodes edge and gradient structure, not image content. Photos with similar compositional lines—corridors, horizon lines, architectural grids—can produce similar gradient patterns without being copies of your reference. At loose thresholds this causes false positives. If false positives persist at strict thresholds, switch to pHash (encodes frequency‑domain content, more structurally discriminating) or Color Signature (also compares colour).
”How do I decide which file to keep when I find a match?”
Ctrl+Click the reference and a match card, then click Compare. The modal shows both side by side with dimensions, file size, format, and a similarity percentage. For brightness‑adjusted versions, deciding which to keep is more nuanced than usual—the “correct” exposure depends on artistic intent and your workflow. Check both file sizes (larger = more data = better quality for same resolution) and decide based on which exposure looks most natural or is closest to your intended output.
”Why does video scanning pause when I switch tabs?”
Browsers throttle video decoding when a tab is hidden. Sakarto pauses video frame extraction automatically and resumes when you return. Image hashing runs in a background Web Worker and is unaffected by tab visibility—images continue processing at full speed regardless of which tab you have open.
”Can I recover files after deleting them?”
No. The File System Access API’s remove() method permanently deletes files without using the OS Recycle Bin. The reference file is always protected and cannot be deleted. Use Queue Mode for all matched files: stage, preview, compare against the reference, then execute only when certain.
”Does this work on Firefox or Safari?”
Reference processing, folder scanning, result display, and the Compare modal all work in Firefox and Safari. Move and Delete require the File System Access API (Chrome 86+ and Edge 86+ only). In other browsers, complete the search and use Download List to export a report for manual file management.
Final thoughts
dHash reverse search is the tool you reach for when your reference’s copies have been exposure‑adjusted, colour‑graded, or brightness‑corrected. It’s the only algorithm in Sakarto’s reverse search toolkit that deliberately ignores absolute brightness values, making it uniquely effective for finding copies that other algorithms miss.
It’s particularly effective for:
- Exposure‑adjusted copies. The same photo brightened or darkened by a few stops.
- HDR vs standard versions. HDR processing often preserves gradient directions.
- Colour‑graded variants. As long as the grading doesn’t shift where edges appear.
- Mixed‑camera libraries. Different cameras have different default brightness—dHash normalises this away.
- Instagram‑filtered or edited versions. Heavy colour grading often preserves luminance gradient structure.
Where dHash falls short—rotated, heavily cropped, or dramatically filter‑destroyed copies—other Sakarto algorithms fill the gap. Use ORB for geometric transforms, pHash for precision edits, or Color Signature for colour‑aware matching.
But for brightness‑adjusted photo collections, dHash is the algorithm that finds the copies the others miss.
Ready to find every copy of your reference image or video with exposure variations?
- Open dHash Reverse Search — free, browser‑based, no install
- Try Find Duplicates with dHash — auto‑group all similar files without a reference
- Explore All 7 Reverse Image & Video Algorithms — compare with Color Signature, aHash, BlockHash, pHash, wHash, and ORB
