I built a free, offline photo resizer for Pakistani government forms (FPSC, PPSC, NADRA) — here's what the forms actually require
Every government form in Pakistan has a different photo rule, and none of them explain it well: FPSC wants a JPG under 30 KB, PPSC under 25 KB, Pak Navy under 20 KB, the passport portal 350x467 pixels. A phone photo is 3
Every government form in Pakistan has a different photo rule, and none of them explain it well: FPSC wants a JPG under 30 KB, PPSC under 25 KB, Pak Navy under 20 KB, the passport portal 350x467 pixels. A phone photo is 3 MB. Thousands of applications fail at the upload step every week.
So I built FormKB (https://formkb.com), a set of browser-only tools: the photo never leaves the device (Canvas API, no upload), and each form has a preset read from the organisation's own guidelines PDF, quoted on the page.
A few things I learned building it:
The limits on blogs are often wrong. I read the official documents and found PPSC's "140x177" and NTS's "50 KB" repeated everywhere without a source. Every preset on the site links the PDF it came from: https://formkb.com/photo-size-requirements
"KB" is not a pixel size. People search "20 KB photo size in pixels" constantly, so I wrote the conversion down with a table instead of a formula that doesn't exist: https://formkb.com/guides/kb-to-pixels
Binary search on JPEG quality beats guessing. The resizer picks the largest pixel size and quality that still fits under the limit, in the browser, usually in under a second.
The same engine works for other countries' forms once you have the official spec: UK passport (600x750 px, 50 KB–10 MB), Bangladesh Teletalk (300x300 under 100 KB), India's JEE Main (10–200 KB): https://formkb.com/jee-main-photo-signature-size
Stack: Next.js static export on Cloudflare, no backend, no analytics. Tests run the real tools in headless Chrome against the stated limits (252 checks).
If you've fought a government upload form, I'd like to hear which one; the next presets come from those stories.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.