← Back to blog

Reverse Image Search with wHash: The Speed‑to‑Quality Sweet Spot for Reference Searching

Upload a reference image or video and Sakarto finds all similar copies using wHash (Wavelet Hash) — a multi-level Haar wavelet transform that balances speed and accuracy. Perfect for finding re-compressed, resized, and lightly edited copies of a specific file. Free, browser-based, and 100% private.

Sakarto wHash reverse search interface showing reference pinned and protected with matched files below

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 wHash (Wavelet Hash) algorithm, you get the best of both worlds: near-pHash accuracy at aHash-like speed. wHash uses a multi-level Haar Wavelet Transform on a 64×64 canvas—capturing the image’s structure at multiple scales simultaneously. It reliably finds resized, re-compressed, and lightly edited copies of your reference while being significantly faster than pHash.


What makes wHash reverse search different from other algorithms?

All hash-based algorithms—Color Signature, aHash, dHash, pHash, and BlockHash—produce a hash and compare using Hamming distance. But wHash is unique because it uses a multi-level wavelet decomposition that captures structure at multiple scales simultaneously.

In the duplicate finder, wHash uses a 16×16 canvas. In reverse search, it uses a 64×64 canvas with a full multi-level wavelet transform—more rounds of averaging and differencing produce a richer low-frequency fingerprint. The result is accuracy comparable to pHash with noticeably better speed, because the Haar wavelet transform is computationally cheaper than the Discrete Cosine Transform.


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:

  1. Computes its fingerprint using wHash
  2. Shows a thumbnail preview so you can confirm the right file was loaded
  3. Pins it at the top of the results as soon as scanning starts
  4. Displays a blue REFERENCE badge on the card
  5. 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 wHash algorithm works

The wHash 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 64×64, converted to grayscale, and a multi-level Haar Wavelet Transform is applied. The top-left 8×8 LL sub-band is extracted and thresholded against the median to produce a 64-bit hash. The reference card appears immediately with a blue REFERENCE badge.

Why 64×64 here instead of 16×16? In the duplicate finder, every file is compared against every other (O(n²)), so smaller canvas = faster hashes. In reverse search, every file is compared only against the reference (O(n)), so the extra accuracy of a larger canvas is worthwhile.

Step 2: Shrink each folder file to 64×64

For each image in the scanned folder, Sakarto draws it onto a 64×64 canvas. In Fast Mode, JPEG files use their embedded EXIF thumbnail instead of the full image, making scans 5–10× faster. Videos extract 3 frames and average them.

Step 3: Convert to grayscale

Each pixel is converted to a single brightness value using the standard luminance formula. Colour is discarded at this stage—wHash, like all hash algorithms in Sakarto, is colour‑blind.

Step 4: Apply multi-level Haar Wavelet Transform

A full multi-level Haar Wavelet Transform is applied in-place:

  • Rows are processed first (averages to the left half, differences to the right)
  • Columns are then processed (averages to the top half, differences to the bottom)
  • This repeats across multiple passes, each halving the resolution of the low-frequency region

After all passes, the top-left 8×8 corner of the 64×64 matrix contains the LL sub-band—the lowest-frequency approximation of the entire image, derived from many levels of wavelet decomposition.

Step 5: Extract the 8×8 LL sub-band and compute the hash

The top-left 8×8 = 64 wavelet coefficients are extracted. The median of these 64 values is computed (instead of the mean, which is more robust to outliers). Each coefficient is compared to the median: 1 if above, 0 if below. The resulting 64-bit binary string is the wHash fingerprint.

Step 6: Compare against the reference using Hamming distance

To compare a folder file against your reference, Sakarto XORs their 64-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 7: 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 wHash reverse search finds well

Type of copyHow well it worksWhy
Exact copies of your reference✅ ExcellentThe hash will be identical.
Reference saved at different resolutions✅ ExcellentResizing to 64×64 removes resolution differences.
Re-exported copies in different formats (JPEG → PNG → WebP)✅ ExcellentFormat conversions affect pixels but not low-frequency wavelet structure.
Re-compressed or lower-quality versions✅ Very GoodThe LL sub-band is stable across most compression levels.
Lightly edited copies with local changes✅ Very GoodMulti-scale wavelet decomposition captures unchanged regions.
Copies with mild colour grading or brightness changes✅ GoodLuminance structure is largely preserved.
Screenshots of the reference image✅ Very GoodScreenshots preserve structural content.
Videos sharing key visual scenes with the reference✅ GoodVideo frames are averaged.
Heavily edited or filtered copies⚠️ May missExtreme edits change structural content.
Rotated or mirrored versions❌ Won’t findWavelet transform is not rotation-invariant. Use ORB.
Dramatically cropped versions (over 30% removed)❌ Won’t findStructural content shifts too much.

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 rangeWhat it doesWhen to use
0–5 (Very strict)Only near-identical hashes match. False positives are very rare.Finding exact copies and very close re-exports of your reference.
6–15 (Balanced)Catches resized, re-compressed, and lightly edited copies.Default and recommended. Good starting point for most reverse searches.
16–25 (Loose)Includes more approximate structural matches. More false positives.If you’re missing copies that look similar but have been significantly edited.
30+ (Very loose)Groups images with broadly similar wavelet patterns.Only use for exploration. Expect false positives—always preview before acting.

Tip: Start at 10. If you’re missing copies you know exist, raise the threshold. If you’re getting too many false positives, lower it.


How to use wHash 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.

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.

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 the main thread for the reference search (no Web Worker needed since it’s O(n)). 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 SearchFind Duplicates
What it doesFinds copies of one specific reference fileGroups all similar files in a folder
ComplexityO(n) — each file compared against referenceO(n²) — all files compared against each other
SpeedFaster for large foldersSlower for large folders
Reference protectionYes — reference pinned and cannot be deletedNo — all files are treated equally
Best forYou know exactly which file you’re looking forYou 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.


Sakarto gives you seven visual algorithms for a reason—each one handles a different type of duplication problem. Here’s when to pick wHash over the others:

Color Signature — colour accuracy

Color Signature is the only algorithm that compares actual colour.

Use wHash instead: Speed is your priority and colour accuracy doesn’t matter. wHash ignores colour and is faster than Color Signature.

aHash (Average Hash) — speed above all else

aHash is the fastest algorithm—it reads individual pixels and compares them to the overall mean.

Use wHash instead: You need better accuracy than aHash but still want good speed. wHash’s multi-level wavelet transform catches more edited copies than aHash while being only slightly slower.

BlockHash — noise tolerance

BlockHash averages brightness over blocks, making it tolerant of compression noise.

Use wHash instead: You want fewer false positives than BlockHash. wHash’s wavelet encoding is more discriminating than block averaging.

dHash (Difference Hash) — brightness and exposure-adjusted copies

dHash encodes gradient directions and handles exposure shifts well.

Use wHash instead: Your reference’s copies have been edited in ways beyond just brightness changes. wHash is more broadly stable across a wider range of edits.

pHash (Perceptual Hash) — the precision choice

pHash uses the Discrete Cosine Transform on a 32×32 canvas—the most precise but most computationally intensive.

Use wHash instead: You want pHash-like accuracy with better performance. wHash typically produces nearly identical results to pHash in reference search at lower CPU cost because the Haar wavelet transform is cheaper than DCT.

ORB (Feature Matching) — rotation, cropping, and perspective

ORB is the only algorithm that handles rotation, cropping, and perspective distortion.

Use wHash instead: Your reference’s copies are not rotated or heavily cropped. wHash is 100× faster than ORB for this use case.

wHash — speed/quality balance specialist

wHash is the algorithm you choose when you want near-pHash accuracy with noticeably better speed. Use it when you’re scanning large folders and want reliable results without waiting for pHash’s DCT computations.

Use wHash when: You have a large folder (5,000+ files), want good accuracy for re-compressed and lightly edited copies, but don’t want to wait for pHash. The 64×64 multi-level wavelet transform gives richer fingerprints than aHash without the computational cost of pHash.


AlgorithmBest forColour‑aware?Handles rotation?Handles cropping?SpeedAccuracy
Color SignatureSame colour palette, social media re‑uploads✅ Yes❌ No❌ NoFastHigh (colour)
aHashLarge folders, speed priority❌ No❌ No❌ NoFastestLow
BlockHashHeavily compressed JPEGs, noisy images❌ No❌ No❌ NoVery FastMedium
dHashBrightness/exposure‑adjusted copies❌ No❌ No❌ NoVery FastMedium
pHashFormat conversions, watermarks, precision❌ No❌ No❌ NoFastHighest
wHashSpeed + quality balance, local edits❌ No❌ No❌ NoVery FastHigh
ORBRotated, cropped, perspective‑warped❌ No✅ Yes✅ YesSlowerHigh

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 (wHash reverse search specific)

“Why does wHash reverse search use a 64×64 canvas when the duplicate finder uses 16×16?”

In the duplicate finder, every file must be compared against every other file (O(n²) comparisons). Keeping the canvas at 16×16 makes each hash extremely fast so the total scan time stays manageable. In reverse search, every folder file is compared against only your one reference (O(n) comparisons)—one pass through the folder is all that’s needed. The lower comparison count makes it affordable to use a 64×64 canvas and a multi‑level Haar wavelet decomposition, which extracts a richer fingerprint. The result is better matching accuracy for your specific reference, particularly for files that have been moderately edited or have regional changes in one area of the image.

”Why use wHash reverse search instead of pHash or dHash?”

All three are solid choices for different reasons. wHash applies a Haar Wavelet Transform and encodes the low‑frequency LL sub‑band—capturing the multi‑scale structural overview of the image. It’s typically faster than pHash (wavelet computation is cheaper than 2D DCT on a 32×32 canvas) and produces comparable quality for most photo duplicates. Choose pHash if you need maximum precision for subtly edited copies—its DCT encoding is more discriminating at the boundary between matching and non‑matching. Choose dHash specifically for copies with significant brightness or exposure adjustments. Choose wHash as a general‑purpose first choice that handles the majority of copy types (re‑compression, format conversion, mild edits) at very good speed.

”Does my reference file need to be inside the folder I’m scanning?”

No—select it from anywhere on your computer. Sakarto automatically skips it if it exists inside the scanned folder, matched by filename, file size, and last‑modified timestamp. The reference card is always pinned at position 0 and is protected from deletion regardless of what’s in the scanned folder.

”A copy of my reference isn’t appearing. What should I try?”

First, raise the threshold toward 15–18. Second, check aspect ratios—pairs differing by more than 10% are excluded before hashing runs. Third, consider the type of edit: wHash handles re‑compression, format changes, mild colour edits, and watermarks well. Like all hash algorithms, it cannot match rotated images—use ORB Reverse Image Search for rotation, mirroring, or perspective distortion. For very extreme brightness changes, dHash may perform better since it specifically encodes gradient direction rather than absolute values. Fourth, confirm the copy is in a supported format and under 40 MB.

”Does wHash handle locally edited copies better than pHash?”

Slightly, yes—and this is one of the meaningful differences between the two. Haar wavelets decompose the image at multiple spatial scales simultaneously, so the LL sub‑band captures structure at different levels of detail. If a copy of your reference has been locally edited in one region (a watermark added, an object cloned out, a face blurred), the wavelet sub‑band reflects the unchanged regions more robustly than a global DCT because the multi‑scale decomposition distributes the unchanged structural information across multiple wavelet coefficients. pHash’s DCT is more sensitive to concentrated changes in specific frequency ranges. In practice the difference is small, but wHash is the marginally better choice for copies with local rather than global modifications.

”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 files side by side with exact dimensions, file size, format, and a similarity percentage. Keep the largest file size (more data = better quality at the same resolution), or the highest resolution if sizes are similar. If one is lossless (PNG) and the other compressed (JPEG), the lossless version is generally worth keeping. For version‑controlled edits (e.g. a retouched version vs. the original), check both the similarity score and the image content carefully before deciding which is the “better” copy.

”Why does video scanning pause when I switch tabs?”

Browsers throttle video element processing when a tab is hidden, stopping frame extraction. Sakarto detects this via the Page Visibility API and pauses video scanning, resuming when you return. Image hashing runs in the main thread for the reference search and is not subject to tab‑visibility throttling—images continue scanning at full speed in the background.

”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 or Trash. The reference file is always protected. For all matched files, use Queue Mode: stage them, preview each one with the full‑size icon, compare against the reference in the Compare modal, and execute only when certain.

”Does this work on Firefox or Safari?”

Reference processing, folder scanning, wavelet computation, 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

wHash reverse search is the tool you reach for when you need the best balance of speed and accuracy. It’s not quite as fast as aHash, and it’s not quite as precise as pHash—but it’s close to both, making it the ideal choice for large reference searches where every millisecond counts.

It’s particularly effective for:

  • Large folder reference searches. When you have 5,000+ images and need good results without waiting for pHash.
  • First‑pass discovery. Run wHash to quickly find obvious copies, then use pHash or Color Signature for a second pass on the results.
  • Finding re-compressed and lightly edited copies. wHash handles these reliably.
  • Local edits and watermarks. The multi-scale wavelet decomposition handles region-specific changes better than pHash.

Where wHash falls short—rotated, colour‑graded, or heavily cropped copies—other Sakarto algorithms fill the gap. Use ORB for rotated or cropped copies, pHash for maximum precision, or Color Signature for colour‑aware matching.

But for speed and accuracy combined, wHash is the algorithm that finds the copies the others miss without the wait.

Ready to find every copy of your reference image or video with wHash?

May 20, 2026
⏱ 20 min read
🇬🇧 English