Reverse Image & Video Search — dHash

Upload a reference file and select a folder to search for similar images and videos using dHash matching.

Step 1 — Select Reference File

Choose a single image or video file to use as reference

Step 2 — Select Folder to Search

Select a folder containing images/videos to search.

Ready
0 items

📐 How dHash Reverse Image Search Works — Complete Guide

Upload one reference image or video and Sakarto scans a folder to find everything that looks similar to it using Difference Hash (dHash). Particularly effective when the copies have been brightness‑adjusted, colour‑graded, or contrast‑corrected. The reference card is always pinned first — protected from move or delete.

100% Private — Your Files Never Leave Your Computer All hashing runs locally in your browser. No uploads, no accounts, no tracking. Close the tab and all data is gone.

🔁 What Is Reverse Image Search?

Reverse Image Search lets you say “find me all copies and similar versions of this specific file.” You choose one image or video as your reference, then Sakarto scans a folder and compares every file against it using the dHash gradient fingerprint.

dHash reverse search is especially powerful when the copies you're hunting have been brightness‑adjusted, colour‑corrected, or given a different look in post‑processing. Because dHash captures the direction of brightness transitions rather than absolute values, it finds these edits where other algorithms miss them. The reference card is always pinned at position 0 with a blue REFERENCE badge and cannot be moved or deleted.

Exposure‑Resilient

Gradient‑based matching finds copies that have been brightened, darkened, or had their contrast tweaked — changes that fool absolute‑value algorithms.

Scan Any Folder

Select a folder and Sakarto hashes every image and video in it, comparing each against your reference using Hamming distance on the gradient hash.

Reference is Protected

The reference card is always pinned first. It cannot be accidentally moved or deleted. Move and Delete only apply to matched files.

Live Results

Matches appear card by card as each file is processed — no need to wait for the full scan to finish.

🧠 How the dHash Algorithm Works

Both the reference file and every folder file go through the same dHash pipeline. In reverse search, each folder file is compared only against the reference — not against each other — which is faster for large folders.

  1. Process the Reference File Immediately

    When you select your reference, Sakarto processes it right away. It resizes to 17×16 pixels, converts to grayscale, compares adjacent pixel pairs row by row, and produces a 256‑bit gradient hash. A thumbnail preview appears so you can confirm the correct file was loaded.

  2. Resize Each Folder File to 17×16

    For each image in the scanned folder, Sakarto draws it onto a 17×16 canvas — one pixel wider than tall. In Fast Mode, JPEG files use their embedded EXIF thumbnail for speed with near‑identical accuracy. Videos use 3‑frame majority‑vote averaging.

  3. Grayscale & Horizontal Gradient Hash

    Each pixel is converted to grayscale using 0.299×R + 0.587×G + 0.114×B. For each of the 16 rows, each pixel is compared to the pixel immediately to its right. Left brighter than right → bit 1; left equal or darker → bit 0. This produces a 256‑bit fingerprint of the image's brightness transition structure.

  4. Compare Against the Reference Using Hamming Distance

    The folder file's gradient hash is XOR'd against the reference hash. The number of differing bits is the Hamming distance. An aspect ratio pre‑check first discards pairs where proportions differ by more than 10%. If the distance is at or below the threshold, the file is added to the results as a match.

  5. 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 the moment it is found. The result count updates live as new matches are added during the scan.

  6. Re‑Search on Threshold Change

    If you adjust the similarity threshold slider, the search re‑runs against all already‑processed hashes in a background Web Worker — no re‑scanning needed. The reference card always stays pinned at position 0.

O(n), not O(n²). In the folder duplicate finder, every file is compared against every other file. In reverse search, each folder file is compared only against the reference — much faster for large folders and results are already sorted by relevance to your specific file.

🎚️ The Similarity Threshold Slider

The Similarity Threshold slider (0–50) controls the maximum number of hash bits that can differ between a folder file and the reference for that file to be considered a match. Adjusting it re‑filters results instantly — no re‑scan needed.

Low values (0–5) — Very strict

Only near‑identical gradient patterns match the reference. Use for finding exact copies and directly re‑exported versions. Very few false positives.

Medium values (6–20) — Balanced (default: 10)

Catches resized, re‑compressed, and brightness/colour‑adjusted copies of the reference. Good starting point. dHash is particularly useful here because it finds exposure‑adjusted copies that other algorithms miss.

High values (21–50) — Loose

Includes files with broadly similar edge structure to the reference, even if the content is visibly different. Always preview before acting at these values.

Lower = stricter. The slider measures the maximum number of differing hash bits allowed. A value of 0 means “only identical gradient patterns match.” A value of 10 means “accept up to 10 bit differences out of 256.”

✅ What It Finds — and What It Might Miss

✅ Finds Well
  • Exact copies of the reference at any resolution
  • The same file re‑saved in a different format
  • Brightness‑adjusted or exposure‑corrected versions
  • Contrast‑tweaked or lightly colour‑graded copies
  • Re‑compressed JPEG versions
  • Screenshots of the reference image
  • Minor structural edits that preserve edge directions
⚠️ May Struggle With
  • Heavily cropped versions (edges shift in the grid)
  • Rotated or mirrored copies
  • Heavily posterized or filtered images that eliminate gradients
  • Large watermarks or text overlaid on the reference area
  • Very dramatic brightness inversions (shadows become highlights)
  • Completely different scenes with coincidentally similar edge structure
For rotated or heavily cropped versions of your reference, try ORB Reverse Image Search. For colour‑accurate matching, try Color Signature reverse search. For noise‑heavy or badly compressed versions, BlockHash reverse search handles artifacts more gracefully.

📋 Step‑by‑Step: How to Use dHash Reverse Image Search

Step 1

Select Your Reference File

Click Choose Reference File. Pick any image or video from your computer — it does not need to be inside the folder you're about to scan. Sakarto processes it immediately and shows a thumbnail preview so you can confirm the correct file was selected.

Supported formats: JPEG, PNG, GIF, WebP, BMP (images) and MP4, WebM, MOV, MKV (videos). Files over 40 MB are not supported as reference files.

Step 2

Select the Folder to Search

Once your reference is loaded, click Choose Folder to Search. A native folder picker opens (Chrome / Edge), or drag and drop a folder onto the page. If your reference file happens to be inside the scanned folder, Sakarto automatically skips it (matched by filename, size, and last‑modified date).

Step 3

Start the Search

Click 🔍 Start Search. A progress bar shows how many files have been processed. The reference card appears immediately at position 0 with a blue REFERENCE badge. Matching files appear live as the scan runs.

Image hashing runs in a background Web Worker — you can switch tabs freely. 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 sensitivity. Releasing the slider triggers an instant re‑search on already‑computed hashes. If you're looking for brightness‑adjusted copies specifically, try a medium threshold (10–15) — dHash often catches them where other algorithms require a much higher threshold.

Step 5

Review the Results

The reference card is pinned at position 0. All matched files follow. Use preview and compare to verify before acting:

  • Click a match card to select it (blue border)
  • Ctrl+Click the reference + a match, then click ⚖️ Compare to see them side‑by‑side with a similarity percentage
  • Click the 🔍 icon on hover to preview full size
  • Right‑click any card for the context menu (Move/Delete are disabled for the reference card)
Step 6

Act on Matches — Move or Delete

Select match cards you want to act on (the reference cannot be moved or deleted). Use the toolbar with Queue Mode on (recommended):

📋 CopyCopy filename(s) to clipboard
📂 MoveStage for move to a named subfolder
🗑️ DeleteStage for permanent deletion
⚖️ CompareView files side‑by‑side with similarity %
Step 7

How the Reference File is Protected

The reference card at position 0 is protected throughout the session. Move and Delete are silently blocked if you include it in a selection. The context menu grays out Move and Delete for the reference card. In the Compare modal, the reference card shows only a Copy button — no Move or Delete.

🏛️ Quick Reference — All Controls

All toolbar buttons, checkboxes, and keyboard shortcuts for reverse search
Button / ActionWhat it does
Choose Reference FileSelect the image or video to search for. Shows a preview once loaded.
Choose Folder to SearchSelect the folder to scan. Activates after reference is loaded.
🔍 Start SearchBegin scanning. Reference card appears immediately; matches render live.
🔄 New SearchReload the page and start fresh with a new reference file
📋 Copy (N)Copy selected filenames to clipboard. N = count selected.
📂 Move (N)Move match files or stage in the Move Queue (reference excluded)
🗑️ Delete (N)Delete match files or stage in Delete Queue (reference excluded)
✕ Deselect AllRemove selection from all cards
⚖️ Compare (N)Open compare modal for Ctrl+clicked files. Needs 2+.
🔇 VideosToggle mute/unmute for all video cards
Queue Mode checkboxStage files for review before executing. Recommended on.
Fast Mode checkboxUse EXIF thumbnail for JPEG hashing — much faster.
Similarity Threshold sliderMaximum Hamming distance allowed. Lower = stricter. Re‑searches on release.
Click match cardSelect / deselect (blue border)
Ctrl + Click cardsAdd to compare list (purple border). Works on reference card too.
Click & drag (empty area)Box‑select multiple match cards at once
Right‑click cardContext menu. Move & Delete are disabled on the reference card.
🔍 hover iconOpen full‑size preview. Reference card shows type as “REFERENCE FILE”.
Hover video cardAuto‑play the video clip

⭐ What Users Say

Based on 109 reviews

"I had hundreds of photos with different brightness levels from various cameras. dHash reverse search grouped them perfectly — exposure differences didn't fool it at all. A fantastic tool for cleaning up inconsistent photo collections."

"dHash caught duplicates that aHash completely missed because the images were exposure‑corrected. The gradient‑based approach is brilliant for real‑world photo libraries where brightness isn't consistent."

"I use dHash reverse search as my first pass for any folder where I know there are exposure variants. It's fast and reliable. I then use Color Signature for colour‑based duplicates. A great combination."

"I work with scanned documents that have been brightened and contrast‑corrected. dHash finds the original and all processed versions in one search. The threshold slider is perfect for tuning the sensitivity."

💡 Tips for Best Results

Back Up First

Always back up your files before deleting anything. Deleted files bypass the recycle bin and cannot be recovered.

dHash Excels at Exposure Variants

If your reference was edited for brightness or contrast before being copied, dHash is often the right algorithm. It finds these variants where aHash would miss them.

Use a Neutral‑Exposure Reference

Choose an unedited version of the file as your reference if possible. A very over‑ or under‑exposed reference may have flattened gradients that produce a less distinctive hash.

Compare Before Acting

Ctrl+Click the reference and a match card, then click Compare to see the exact similarity %. This is especially important with dHash since similar compositional lines in different images can match at moderate thresholds.

Use Fast Mode for JPEG Folders

Fast Mode reads EXIF thumbnails instead of full images — 5–10× faster. dHash's pixel‑level gradient comparison is not significantly affected by thumbnail quality differences in practice.

No Results? Check Aspect Ratio First

Pairs with aspect ratios differing by more than 10% are excluded before any comparison. If your reference is portrait and the folder files are landscape versions of the same scene, they won't match — try ORB instead.

⚠️ Known Limitations

Rotation and mirroring break matching.

A rotated version of the reference has its horizontal gradients transposed to vertical gradients, producing a completely different hash. A mirrored copy reverses all gradient directions. Use ORB Reverse Image Search for rotation‑tolerant matching.

Heavy cropping shifts edge positions in the 16×16 grid.

If the matching copy was significantly cropped, the remaining content maps to a different part of the gradient grid. For heavily cropped copies, try pHash or ORB reverse search.

Reference file does not need to be in the scanned folder.

The reference is loaded independently. If it happens to be inside the scanned folder, Sakarto detects and skips it automatically (matched by filename, file size, and last‑modified date).

No undo for file deletion.

The File System Access API bypasses the OS recycle bin. Use Queue Mode to review before executing. The reference file cannot be deleted regardless.

Move and Delete require Chrome or Edge.

The File System Access API is only available in Chrome 86+ and Edge 86+. Firefox and Safari can run the search and display results but cannot move or delete files.

🔒 Privacy & Security

Zero network activity after page load. All hashing runs locally. Open DevTools → Network tab during a search: zero outbound requests to any server.
No accounts, no cookies, no analytics. The only localStorage data saved is your checkbox preferences. No file names, paths, reference files, or hashes are ever saved or transmitted.
Folder access is scoped and session‑only. Permission is granted only for the folder you select, lasts only while the tab is open, and is revocable from browser site settings.
Purely static — no backend. Sakarto is HTML, CSS, and JavaScript. There is no server, no database, and no API endpoint receiving data from you.

❓ Frequently Asked Questions

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.