Back to feed
Dev.to
Dev.to
6/17/2026
I built an image compressor that hits an exact KB size — and never uploads your files

I built an image compressor that hits an exact KB size — and never uploads your files

Short summary

Developer built SwiftShrink, a browser-based image compressor that achieves exact KB targets without uploading to servers. It uses binary search over JPEG quality combined with dimension shrinking to converge on the largest image fitting the byte budget. All processing happens locally via the Canvas API—files never leave the browser.

  • Client-side compression via Canvas API eliminates privacy risk of uploading to external servers
  • Binary search algorithm finds optimal JPEG quality; dimension shrink fallback handles aggressive targets
  • Exact KB targets achieved reliably across diverse inputs; fully static tool with zero compute cost

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more