DEV Community

Cover image for How I Built a Pure Client-Side Image Compressor (No Server, No API)
entry bypass
entry bypass

Posted on

How I Built a Pure Client-Side Image Compressor (No Server, No API)

Most image compression tools upload your photos to a server. That’s fine for casual images, but not okay when users are working with personal documents like Aadhaar cards, PAN cards, or government exam forms.

I ran into this issue myself while helping someone upload a photo with a strict 20KB file size limit. Most tools either broke the quality or failed to hit the exact size. So I decided to build my own tool that works 100% inside the browser — no backend, no APIs, no uploads.

That’s how ResizeKB.tech was born.

PROBLEM I WANTED TO SOLVE

Government and job application portals in India often require:

  • Exact file size limits (20KB, 50KB, 100KB)
  • Specific dimensions
  • Clean background images
  • No quality loss

Most tools:

  • Upload images to a server
  • Compress blindly
  • Don’t allow exact KB targeting
  • Create privacy issues

My goal was:

  • Exact size control
  • No server
  • No upload
  • Works instantly

TECH STACK

  • HTML5
  • Vanilla JavaScript
  • HTML Canvas API
  • Browser File API

HOW IT WORKS

  1. User selects an image
  2. Image loads using FileReader
  3. It is drawn onto a hidden canvas
  4. Quality + resolution are adjusted
  5. Export happens using canvas.toBlob()
  6. Loop runs until exact KB size is reached

Everything happens locally. No file is uploaded anywhere.

BIGGEST CHALLENGES

  • Maintaining quality under 20KB
  • Handling large phone images
  • Browser memory crashes
  • Different compression results in different browsers

PRIVACY

  • No login
  • No uploads
  • No server
  • No tracking

LIVE TOOL

https://resizekb.tech

You can check the browser Network tab — there is zero upload.

FINAL NOTE

This started as a personal fix for government form uploads and slowly became a daily-use tool for thousands of users.

If you're building browser-based tools or care about privacy-first apps, happy to connect.

Top comments (0)