Logic SpineLogic Spine
  • About
  • Products
  • Team
  • Contact
  • Blog
  • Feedback
  • Try UnderKB
Logic SpineLogic Spine

R&D and product studio focused on real, underserved gaps. We build and run flagship products like Sumikar, ASK, and UnderKB for high-stakes gaps where execution matters.

Company

  • About
  • Products
  • Team
  • Contact
  • Blog
  • Feedback

Products

  • Sumikar
  • ASK
  • UnderKB

© 2026 Logic Spine. All rights reserved.

sumikar.logicspine.com·ask.logicspine.com·underkb.logicspine.com
0%·5 min left
Home/Blog/How to compress an image to exact KB for passport and government portals

How to compress an image to exact KB for passport and government portals

28 June 2026·5 min read
UnderKBpassport photoimage compressiongovernment portalexact file size
Share

You have the right passport photo. Dimensions look fine. Face is centred. Background is white. You click upload — and the portal rejects it: "File size must be between 20 KB and 50 KB."

Your file is 51 KB.

This scenario plays out thousands of times a day on Indian government sites, university admission portals, and competitive exam platforms. The fix is not "compress a bit harder." You need exact KB compression — hit the limit precisely without breaking readability rules.

Why portals enforce exact file sizes

Government systems optimise for storage, bandwidth, and batch processing on infrastructure that was not built for 5 MB phone photos. Strict KB limits:

  • Keep databases predictable
  • Reduce upload failures on slow connections
  • Standardise verification pipelines (face detection, OCR on documents)

Portals rarely negotiate. A 51 KB file when the max is 50 KB fails — even if a human can see no difference.

Why generic compressors fail

Most online tools offer a quality slider or percentage reduction. That is the wrong abstraction when the portal says "max 50 KB."

ApproachProblem
Resize onlyMay fix dimensions but not size
Quality sliderNo guarantee you land under the limit
"Save for web" in editorsTrial and error; wastes time
Repeated screenshotDestroys sharpness; may fail face checks

You need a tool that targets a specific kilobyte value, not "smaller."

Passport photo requirements (typical patterns)

Rules vary by portal, but common constraints include:

  • File size: e.g. 20–50 KB or "less than 100 KB"
  • Dimensions: e.g. 200×230 px or 3.5 cm × 4.5 cm at specified DPI
  • Format: JPEG only (PNG often rejected)
  • Background: plain white or light coloured
  • Face coverage: percentage of frame occupied by face

Always read the official instruction PDF for your specific application. This article covers the size problem; your portal may add dimension rules on top.

Step-by-step: getting to exact KB

  1. Start from a clean source — Crop to required aspect ratio before compressing. Cropping after compression can push you over the limit again.
  2. Export as JPEG unless the portal explicitly allows PNG.
  3. Set a target KB slightly below the maximum (e.g. 48 KB when max is 50 KB) to leave margin for portal-side metadata quirks.
  4. Verify dimensions if the portal checks pixels, not just file size.
  5. Upload once — if rejected, note the exact error message; some portals report dimension and size separately.

Common rejection reasons beyond file size

  • Aspect ratio — Photo too wide or tall after crop
  • Face too small or too large in frame
  • Background not uniform — shadows or patterns
  • Glasses glare or closed eyes — biometric checks
  • Wrong colour profile — rare but happens with edited RAW files

If size is correct but upload still fails, re-check pixel dimensions and background rules.

Documents other than photos

Many portals also cap PDFs and scanned certificates:

  • "Maximum 300 KB per document"
  • "Combined upload must not exceed 2 MB"

The same exact-size logic applies. Compressing a PDF to precisely 300 KB is a different algorithm than photo JPEG compression, but the user problem is identical: the portal wants a number, not "smaller."

Why we built UnderKB

UnderKB exists because Logic Spine kept hearing the same frustration: "I need this file under 50 KB — why is that so hard?"

UnderKB compresses images and documents to exact KB targets set by you or by common portal presets. No guessing with quality sliders. No upload → reject → retry loop.

We named it UnderKB because the goal is always the same: get under the kilobyte ceiling the portal enforces — reliably.

What UnderKB is good for

  • Passport and visa photo size limits
  • Exam application uploads (UPSC, state PSC, university forms)
  • Scanned ID proofs with strict PDF caps
  • Any workflow where the error message quotes a number in kilobytes

What to still verify yourself

  • Official dimension and background rules for your application
  • Whether the portal accepts the file format you export
  • Print requirements if you also need a physical copy

Tips for mobile users

Phone cameras produce 3–8 MB images. Before opening any tool:

  1. Crop in your gallery app to the required ratio
  2. Use UnderKB with the portal's KB limit
  3. Preview at 100% zoom — text on ID cards must stay readable

Bottom line

Exact KB limits are not arbitrary annoyances. They are hard constraints in systems that will not bend for your nearly-small-enough file.

Stop fighting quality sliders. Pick your target KB, compress precisely, and move on with your application.

Try UnderKB for exact-size compression, or contact Logic Spine if you need a custom document workflow for your organisation.

About the author

HS

Himanshu Sharma

Founder

Founded Logic Spine to build tools that fix real friction — products like Sumikar, ASK, and UnderKB started as problems we couldn't ignore.

Related from Logic Spine

UnderKB compresses images and documents to exact KB limits for government and exam portals — no guesswork. Found a gap worth closing? Tell us what is still broken.

Try UnderKBContact usMore articles

Related reading

sumikarArticle4 July 2026 · 1 min read

CBAM's Financial Phase Has Begun: Why Indian MSME Exporters Can't Wait Any Longer

CBAM's financial phase is live in 2026. Experts warn Indian MSMEs lack the capacity to comply — here's what exporters need to do now. (155 characters)

By Himanshu Sharma · Founder

CBAMEU carbon border taxIndian MSMEscarbon marketCCTSSumikarexport compliancesteel and aluminium exports
askProduct1 July 2026 · 8 min read

What is ASK? Multi-tenant RAG platform for document AI explained

ASK by LogicSpine is a multi-tenant RAG SaaS platform at ask.logicspine.com — upload documents, chat with AI grounded in your knowledge base, and deploy public chat for your users.

By Himanshu Sharma · Founder

ASKRAGknowledge basedocument AImulti-tenant SaaSGenAILogicSpine
sumikarProduct30 June 2026 · 7 min read

What is Sumikar? India's carbon compliance platform explained

Sumikar is Logic Spine's flagship carbon compliance platform for Indian manufacturers and exporters — measure emissions, generate CBAM and BRSR reports, and stay ahead of India's Carbon Market. Here's everything you need to know.

By Himanshu Sharma · Founder

Sumikarcarbon complianceCBAMBRSRICMIndiaSaaS

Comments

Comments are reviewed before they appear.

Loading comments…