Blog ·
How OpenPhotoId makes a passport photo without uploading it
A passport photo has to meet rules most people never see. How tall the head is as a share of the frame. How high the eyes sit. What colour the background is. And, for an online portal, how many kilobytes the file may weigh. OpenPhotoId makes a photo that meets those rules, and it does all of the work on your own device. This is what happens between choosing a photo and downloading the file.
It starts with the document
The app covers 25 documents from 16 countries and the EU: passports, visas, ID cards, India's PAN card and OCI. A US passport photo is 2 × 2 inches on white or off-white, and must not be changed with software. A UK passport photo is 35 × 45 mm on light grey, not white. India's PAN card wants a JPEG between 20 and 50 KB. Every entry records the page its rules came from and the date they were last checked, and the app shows both under "Documents covered". If your document is not on that list, the app does not support it.
Find the face, then the edge of your hair
Two small neural networks run inside the browser tab. A face detector finds five landmarks: the eyes, the nose and the corners of the mouth. Those anchor every rule that follows. A portrait matting model then separates you from the background with a soft edge, and a second pass, zoomed in on your head, resolves hair at full resolution. The background is repainted in the colour the document names.
Both models are downloaded from openphotoid.com the first time you use the app, about 26 MB once, and kept in your browser. After that the app opens with no connection.
Crop to the middle of every band
Head height, eye line and centring each have an allowed range. The crop aims for the middle of all three at once. Three sliders let you move within them if you would rather sit a little higher or lower in the frame.
Twelve checks on the file you will submit
The same twelve checks run on every document: face count, head height, eye line, centring, head tilt, glasses, distance between the eyes, blur, lighting symmetry, background uniformity, resolution and file size. The face is detected again on the finished image rather than trusted from the crop, so the checklist describes the file you download. Each check shows the value it measured and the band it was judged against.
The checks cannot see everything. A portal can still turn a photo down for an expression or a reflection on glasses. Read the checklist rather than assuming a pass.
Export for the portal or the print shop
For a portal, the app searches for the JPEG quality that lands the file inside the document's size window instead of guessing. For printing, it writes a lossless PNG at the right DPI, or tiles the photo onto a 4×6 in, 5×7 in, A4 or Letter sheet with cutting guides.
Why the photo never leaves your device
The core is written in Rust and compiled to WebAssembly, with no HTTP client in it. There is no code path from your photo to a server. You can check this yourself: open your browser's developer tools, switch to the Network panel, and make a photo. Once the page and the models have loaded, nothing else is requested. The app's test suite fails if a request ever leaves the origin. The website counts visits with self-hosted analytics, which never sees your photo.
Free, and who it is for
Every feature is free: hair-level edges, batches of any size with a CSV report, backgrounds beyond a flat colour, and print sheets. There is no watermark and no sign-up. The source is on GitLab under MIT or Apache-2.0.
It is for anyone renewing a passport, applying for a visa online, or doing photos for a whole family in one go, who would rather not send a picture of their face to a website to do it. It works on a phone, where "Take a photo" opens the front camera. iOS 17 cannot run the models in the browser and says so.
Make a photo at the top of the home page.