Skip to content

Ksisa/DuplicateImageFinder

Repository files navigation

DuplicateImageFinder

A .NET console application that finds duplicate and near-duplicate images using perceptual hashing.

What it does

  • Scans a directory for image files (jpg, jpeg, png, gif, bmp, tiff, tif, webp)
  • Uses difference hashing (dHash) to detect similar images
  • Finds both exact duplicates and near-duplicates based on a configurable threshold
  • Optionally creates Windows shortcuts to suspected duplicates for easy review

Usage

dotnet run <directory> [hammingThreshold] [targetDirectory]

Parameters:

  • <directory> - Directory to scan for images (required)
  • [hammingThreshold] - Hamming distance threshold for near-duplicates (optional, default: 4, range: 0-64)
  • [targetDirectory] - Directory to create shortcuts for suspected duplicates (optional)

Examples:

dotnet run "C:\Photos"
dotnet run "C:\Photos" 2
dotnet run "C:\Photos" 4 "C:\Desktop\Duplicates"

Output

  • Lists suspected duplicate pairs with their Hamming distance
  • Shows file paths and sizes
  • Creates shortcuts in specified target directory for manual review (if provided)

How it works

Uses difference hashing (dHash) algorithm:

  1. Resizes images to 9x8 pixels
  2. Converts to grayscale
  3. Compares adjacent horizontal pixels
  4. Generates 64-bit hash
  5. Compares hashes using Hamming distance

Lower threshold = stricter matching (fewer false positives, more false negatives) Higher threshold = looser matching (more false positives, fewer false negatives)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages