<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ZoomApps</title>
    <description>The latest articles on DEV Community by ZoomApps (@zoomapps).</description>
    <link>https://dev.to/zoomapps</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4209265%2F3203cc66-ada1-406d-a5ce-4a9f5d037262.png</url>
      <title>DEV Community: ZoomApps</title>
      <link>https://dev.to/zoomapps</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zoomapps"/>
    <language>en</language>
    <item>
      <title>Finding duplicate photos on iPhone without uploading a single one</title>
      <dc:creator>ZoomApps</dc:creator>
      <pubDate>Mon, 26 Oct 2026 17:22:05 +0000</pubDate>
      <link>https://dev.to/zoomapps/finding-duplicate-photos-on-iphone-without-uploading-a-single-one-1okg</link>
      <guid>https://dev.to/zoomapps/finding-duplicate-photos-on-iphone-without-uploading-a-single-one-1okg</guid>
      <description>&lt;p&gt;Most photo cleaners send your library somewhere or lock the useful part behind a weekly subscription. We wanted the opposite for our app, Fast Cleaner: everything runs on the iPhone, and the free tier covers a normal daily cleanup. Here is how the duplicate finder works and what we learned shipping it to 50 languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. One embedding per photo with Apple Vision
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;VNGenerateImageFeaturePrintRequest&lt;/code&gt; returns a feature vector for an image. Two photos of the same scene end up close to each other, even with small changes in framing or exposure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;VNGenerateImageFeaturePrintRequest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;VNImageRequestHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cgImage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;thumb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[:])&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perform&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;print&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="k"&gt;as?&lt;/span&gt; &lt;span class="kt"&gt;VNFeaturePrintObservation&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We request a 160×160 thumbnail from PhotoKit instead of the full image. Vision resamples to its own input size anyway, and the smaller request loads about 30% faster. Embeddings are cached on the device, so the second scan only processes new photos.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Compare only what can be similar
&lt;/h2&gt;

&lt;p&gt;Comparing every photo with every other one is O(n²). On a 50,000-photo library that is far too slow. We bucket photos by the month they were taken and compare pairs inside a bucket. Duplicates and burst-like series are almost always taken close in time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;d&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;computeDistance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;unionFind&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;union&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A distance threshold of 0.3 gave the best balance between "same moment" and "similar but different". Union-find turns the pairs into groups.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Pick the best shot, offer the rest
&lt;/h2&gt;

&lt;p&gt;Inside each group a simple weighted score picks the photo to keep:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;face capture quality (&lt;code&gt;VNDetectFaceCaptureQualityRequest&lt;/code&gt;): 0.35&lt;/li&gt;
&lt;li&gt;sharpness, Laplacian variance on luminance: 0.30&lt;/li&gt;
&lt;li&gt;resolution, log-scaled: 0.15&lt;/li&gt;
&lt;li&gt;open eyes and smile from face landmarks: 0.15&lt;/li&gt;
&lt;li&gt;newer date as a tiebreak: 0.05&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Photos without faces get a neutral face score, so landscapes are not penalised.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Things that bit us
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Memory.&lt;/strong&gt; Batches of 50 images inside &lt;code&gt;autoreleasepool&lt;/code&gt;, otherwise large libraries run out of memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The simulator lies.&lt;/strong&gt; In the iOS simulator Vision returned the same vector for every image, so all distances were 0 and every photo landed in one group. We now detect "collapsed" embeddings (different sizes, distance exactly 0) and skip such buckets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main thread.&lt;/strong&gt; Reading the photo library during view rendering caused watchdog kills on big libraries. All PhotoKit reads moved off the main thread.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletion safety.&lt;/strong&gt; Deletions go through PhotoKit, so everything lands in Recently Deleted for 30 days.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pricing without a weekly plan
&lt;/h2&gt;

&lt;p&gt;Scanning, the report, swipe-to-clean and up to 300 MB of cleanup a day are free. Pro removes the limit and adds video compression: $1.99/month (first month $0.99), $9.99/year or $19.99 once.&lt;/p&gt;

&lt;p&gt;Fast Cleaner is on the App Store: &lt;a href="https://apps.apple.com/app/id6772155675" rel="noopener noreferrer"&gt;https://apps.apple.com/app/id6772155675&lt;/a&gt; — more at &lt;a href="https://zoomapps.kz/fastcleaner/" rel="noopener noreferrer"&gt;https://zoomapps.kz/fastcleaner/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>iosswiftprivamobilecy</category>
    </item>
  </channel>
</rss>
