<?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: Ankit kapur</title>
    <description>The latest articles on DEV Community by Ankit kapur (@ankit_kapur_add8f25d29724).</description>
    <link>https://dev.to/ankit_kapur_add8f25d29724</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%2F4179184%2F059a9807-9330-427c-800b-35c0844806e2.png</url>
      <title>DEV Community: Ankit kapur</title>
      <link>https://dev.to/ankit_kapur_add8f25d29724</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankit_kapur_add8f25d29724"/>
    <language>en</language>
    <item>
      <title>I measured the State Department's own passport photo examples to build a checker that never edits your photo</title>
      <dc:creator>Ankit kapur</dc:creator>
      <pubDate>Mon, 12 Oct 2026 11:19:40 +0000</pubDate>
      <link>https://dev.to/ankit_kapur_add8f25d29724/i-measured-the-state-departments-own-passport-photo-examples-to-build-a-checker-that-never-edits-5814</link>
      <guid>https://dev.to/ankit_kapur_add8f25d29724/i-measured-the-state-departments-own-passport-photo-examples-to-build-a-checker-that-never-edits-5814</guid>
      <description>&lt;p&gt;The State Department's passport photo page has a line most photo apps quietly ignore: "Do not change your photo using computer software, phone apps or filters, or artificial intelligence." Many passport photo tools auto-fix the photo, replacing the background, smoothing the light and recentering the face. I wanted the opposite: a tool that only &lt;strong&gt;checks&lt;/strong&gt; the photo, and takes it only when it already passes.&lt;/p&gt;

&lt;p&gt;That became &lt;a href="https://picpassed.com" rel="noopener noreferrer"&gt;PicPassed&lt;/a&gt;. Here is how it works and what I learned measuring the official examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  Everything runs in the browser
&lt;/h2&gt;

&lt;p&gt;The photo never leaves the phone. The checks run on the device with MediaPipe's Face Landmarker (&lt;code&gt;@mediapipe/tasks-vision&lt;/code&gt;), which gives face landmarks plus "blendshapes" such as eye blink and jaw open. From those and the raw pixels, the checker measures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Head tilt and turn:&lt;/strong&gt; the angle of the line between the eyes, and how far the nose sits off the face's centre.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eyes and mouth:&lt;/strong&gt; blink and jaw-open blendshapes, plus the gap between the inner lips for "avoid showing teeth".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Even light:&lt;/strong&gt; the darker cheek's brightness compared with the brighter one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The wall:&lt;/strong&gt; brightness, colour and unevenness of the background around the head.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sharpness:&lt;/strong&gt; the variance of the Laplacian over the face.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no shutter button. The camera loop runs the full check on each frame and takes the photo only when a frame passes everything, so nobody takes a photo and is then told it failed. Each failed check has a short hint on screen ("Turn to face the light", "Find a plain white wall").&lt;/p&gt;

&lt;h2&gt;
  
  
  Calibrating against the official examples
&lt;/h2&gt;

&lt;p&gt;The State Department doesn't publish numbers for "not tilted" or "even lighting". It publishes example photos, each marked acceptable or unacceptable. So I ran them through the checker and set the limits in the gap between the two groups. Re-running 21 of them with the current limits:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Accepted examples&lt;/th&gt;
&lt;th&gt;Unacceptable example&lt;/th&gt;
&lt;th&gt;Our limit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Head tilt (adults and children)&lt;/td&gt;
&lt;td&gt;0.3° to 4.7°&lt;/td&gt;
&lt;td&gt;"head tilted to the side": 10.2°&lt;/td&gt;
&lt;td&gt;under 5°&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Even light (darker side vs brighter side)&lt;/td&gt;
&lt;td&gt;86% to 100%&lt;/td&gt;
&lt;td&gt;tilted example with shadows: 55%&lt;/td&gt;
&lt;td&gt;at least 62%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wall brightness (0 black, 255 white)&lt;/td&gt;
&lt;td&gt;188 to 253&lt;/td&gt;
&lt;td&gt;dark photo: 157&lt;/td&gt;
&lt;td&gt;at least 170&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wall colour (0 white or grey)&lt;/td&gt;
&lt;td&gt;up to 11&lt;/td&gt;
&lt;td&gt;blue wall: 65&lt;/td&gt;
&lt;td&gt;34 or less&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every unacceptable example was turned down: blue background, dark photo, eyes closed, head tilted, mouth open, and a baby with a pacifier.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it gets wrong, honestly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The baby with the pacifier fails only because the head is turned. &lt;strong&gt;The checker doesn't see pacifiers.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;It also can't see glasses, hats, scarves, red eye, colour tints, AI changes or textured walls such as white brick. The site says so, and tells people to check those themselves.&lt;/li&gt;
&lt;li&gt;Two accepted examples fail. One is a man in a wheelchair whose head support shows behind him; the State Department accepts that with a note. The other is a baby lying down with the head tilted 9.2°.&lt;/li&gt;
&lt;li&gt;The examples are tiny (200 to 300 pixels), so sharpness and size can't be calibrated from them. Those limits still need readouts from real phones.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full write-up is on the site: &lt;a href="https://picpassed.com/passport-photo-examples/" rel="noopener noreferrer"&gt;acceptable vs unacceptable passport photo examples, measured&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rest of the stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hosting:&lt;/strong&gt; a static site generated by one Node script and deployed on Cloudflare Pages, with a few Pages Functions for checkout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment:&lt;/strong&gt; Stripe Checkout. Checking is free, and you pay only after the photo passes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output:&lt;/strong&gt; the digital file is cropped and resized only, never retouched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've built something with MediaPipe in the browser, I'd like to hear how you handled sharpness on phone cameras. That's the part I'm still calibrating.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>computervision</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
