Skip to content

Add perceptual-hash image dedupe#250

Merged
JE-Chen merged 1 commit into
devfrom
feat/image-dedup-batch
Jun 20, 2026
Merged

Add perceptual-hash image dedupe#250
JE-Chen merged 1 commit into
devfrom
feat/image-dedup-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 20, 2026

Copy link
Copy Markdown
Member

Dependency-light batch (Pillow is already core). Full layers + tests + EN/Zh v42 docs + README.

Feature (utils/image_dedup, Pillow only)

  • average_hash / dhash (perceptual fingerprints via Pillow), hamming_distance / images_similar (bit distance + tolerance), dedupe_images (collapse near-duplicate frames, first wins). Maps visually similar screenshots to close fingerprints so a recording/step report's redundant frames cluster and collapse.
  • No new dependency — Pillow (pillow==12.2.0) is already a core dep; perceptual hashing is implemented directly (no imagehash). The dedupe/compare logic is pure Python with an injectable hasher, so clustering is unit-tested without any image; the real Pillow hashing path runs under importorskip.
  • Executor AC_image_hash / AC_dedupe_images (paths as list or builder JSON string); MCP ac_*; Builder under Image.

Verification

  • 8 tests pass (hamming/similar, dedupe via injected hasher + strict threshold + empty, real Pillow hashing under importorskip, executor round-trip with generated PNGs, wiring, facade); ruff clean; radon no CC≥C; bandit clean; PySide6-free.
  • Stacked on S3 (Add S3-compatible artifact store #249); rebased cleanly onto dev.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 33 complexity · 0 duplication

Metric Results
Complexity 33
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit a3daf70 into dev Jun 20, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/image-dedup-batch branch June 20, 2026 04:16
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant