Every app that accepts photos runs into the same thing sooner or later. A user picks a 6 MB iPhone photo, the upload is slow, the server rejects it, or you pay to store pixels nobody will ever see.
The usual fix is to compress in the browser before upload. I tried the popular libraries and kept running into three problems:
Size. 15β50 KB gzipped, for something that sits on every upload form.
HEIC. iPhones shoot HEIC by default, and only Safari can decode it natively.
Sometimes the "compressed" file is bigger. If you re-encode an already-optimized image at quality 0.8, the result can be larger than what you started with.
So I built Compresso . Here's how it handles each of those.
1. Stay small: only the Canvas API
The core uses only what the browser already has: decode into an Image or ImageBitmap , draw it to a canvas at the target size, and encode with canvas.toBlob (or OffscreenCanvas.convertToBlob in a worker). There's no WASM and no bundled codecs.β¦