πŸ–ΌοΈ

Advanced Deduplicator

Find visually similar images using AI-powered perceptual hashing with customizable similarity thresholds.

Image ⭐⭐⭐ Advanced ⏱️ 5 minutes

😫 The Pain Point

You have the same photo in multiple resolutions, crops, and slight edits. Simple hash comparison won’t catch these β€œnear duplicates” because the bytes are different.

πŸš€ Agentic Solution

An AI-Powered Similarity Detector that finds visually similar images, not just identical ones.

Key Features:

  • Multiple Algorithms: Average hash, Perceptual hash, Difference hash.
  • Adjustable Threshold: Control how similar images need to be to match.
  • Visual Comparison: Side-by-side preview of similar pairs.

βš”οΈ Phase 1: Commander (Quick Fix)

For finding similar images.

Prompt:

β€œI have a folder photos with near-duplicate images. Write a Python script using imagehash to:

  1. Hash Method: Use perceptual hash (phash).
  2. Similarity: Find images with Hamming distance < 10 (adjustable).
  3. Report: Group similar images and print paths.
  4. Dry Run: List only; --delete to remove extras (keep largest file).

Print progress. Show similarity scores. Handle corrupt images gracefully.”

Result: A truly clean photo library with no visual duplicates.

πŸ—οΈ Phase 2: Architect (Permanent Tool)

For Professional Photographers.

Engineering Prompt:

**Role:** Python Tool Developer
**Task:** Create an "Advanced Image Similarity Finder".

**Requirements:**
1.  **GUI:**
    *   Select folder.
    *   Algorithm dropdown (aHash, pHash, dHash).
    *   Threshold slider (0-64 Hamming distance).
    *   Side-by-side comparison viewer.
    *   Batch selection for deletion.
    *   Progress bar with ETA.

2.  **Logic:**
    *   Pre-calculate all hashes (cache for speed).
    *   Compare all pairs (optimize with spatial indexing).
    *   Keep highest resolution by default.
    *   Move deleted to Recycle Bin.

3.  **Deliverables:**
    *   `advanced_dedup.py`
    *   `run.bat`, `run.sh`
    *   `requirements.txt`

🧠 Prompt Decoding

  • Hamming Distance: The number of bits that differ between two hashes. Lower = more similar. 0 = identical.

πŸ› οΈ Instructions

  1. Install: pip install imagehash
  2. Copy Prompt β†’ Run.
  3. Adjust threshold to catch more or fewer matches.

Related Workflows

Explore other categories

πŸ“¬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

πŸ“– Free eBook Guide πŸ“¦ 7 Ready-to-use Scripts πŸ”” Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.