DEV Community

Oshie Labs
Oshie Labs

Posted on

I got tired of government portals rejecting my 104KB photos, so I built an offline Android app with Compose

Last month, a state portal rejected my application because my photo was 104 KB instead of the required 100 KB limit.

My phone shoots photos at 12 MB.

When I searched for a quick compressor, every top website asked me to upload my passport photo to their cloud servers. No clear privacy policy, no idea where the images go.

I wasn't about to hand over my ID to random servers, but existing Play Store apps were either packed with intrusive full-screen ads or relied on vague "low/medium/high" sliders that leave you guessing the output size.

So I spent the last few weeks building Compress-E at Oshie Labs.


The problem with hitting exact KB in Android

In Android, Bitmap.compress(JPEG, quality, stream) takes a quality parameter from 0 to 100. But that's a quantization multiplier, not a file size target.

Setting quality = 75 on a plain wall might output 40 KB, while on a textured background it could stay at 1.5 MB.

To hit an exact target like 95 KB without trial and error, Compress-E runs a quick adaptive binary search loop:

  • First, it downscales unnecessarily massive canvas resolutions.
  • Then, it binary-searches the quality table to converge on the target byte size in 3–4 quick passes.
  • Everything runs on background coroutines so the Compose UI stays smooth at 120Hz.

100% On-Device & Private

Most tools process images in the cloud because server-side processing is easier than managing mobile memory.

Compress-E does everything strictly in device RAM:

  • Zero cloud uploads: Works completely offline.
  • Privacy cleanup: Automatically strips EXIF geolocation metadata so your personal coordinates aren't embedded in uploaded photos.
  • Batch Mode: Shrink multiple photos simultaneously with one tap.

Tech Stack

  • Built 100% with Jetpack Compose & Material 3.
  • iTextG & BouncyCastle for clean ID/document PDF exports.
  • AndroidX ExifInterface for correct orientation handling.

Check it out on Google Play:

👉 Download Compress-E on Google Play

Would love any feedback on the compression speed and UI!

Top comments (0)