Menu

1 / 3

Near-duplicate photos on device with Vision feature prints

DEV Community: swift·Bazi·3 days ago
#kG7mrhOf
#devtoswift#devto#dev#swept#distance
Long article (2273 words) — no AI summary yet.
Reading 0:00
15s threshold

I make Swept, a photo and video cleaner for iPhone and iPad. Its Find Duplicates screen groups near-identical photos so you can keep one and clear the rest. This post walks through how that works in the shipping code: Apple's Vision framework, a distance cutoff, a greedy loop, and a few limits worth stating up front.

Why not hash the files

A camera roll collects near-copies. Five shots of the same sunset because the first might be blurry. A burst. A photo that came back from a chat app, re-compressed, sitting next to the original.

A file hash only matches identical bytes. Re-encode a photo and the bytes change while the picture looks the same. Burst frames were never the same bytes to begin with. So hashing finds exact copies and misses most of the pile people want to clean.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.