AI News Hub Logo

AI News Hub

I built a free image compressor that never uploads your files

DEV Community
Gaurav Bhowmick

Every free image compressor I tried had the same problems: they upload your images to some server, limit you to 5 files a day, or force you to create an account. Load the image into a Canvas element Re-encode it at a lower quality using canvas.toBlob() If the output is larger than the original (happens with PNGs), try progressively lower quality settings If WebP still can't beat the original, fall back to JPEG Always return the smallest successful result Code: // First pass // Smart fallback if output is larger The key insight: Canvas API quality values aren't linear. Quality 0.92 barely compresses anything. Quality 0.65 (our "Smart" preset) gives 50-70% reduction with no visible quality loss. Compress — Gentle (20-40%), Smart (50-70%), Tiny (75-90%) Tech stack Next.js 15 (static export) What I learned Canvas API quality is not what you think. I initially set the "Smart" preset to quality 0.78 thinking that's decent compression. A 3MB PNG screenshot compressed to 3.2MB — larger than the original. Turns out 0.78 is barely any compression for the Canvas encoder. Dropping to 0.65 fixed everything. The multi-pass approach matters. A single-pass compressor will sometimes produce files larger than the original, especially with PNG screenshots. The fallback chain (try lower quality → try different format) ensures the output is always smaller. Static sites are underrated for tools. MiniPx costs $0/month to run. No server, no database, no file storage, no bandwidth costs. The entire thing is HTML/CSS/JS served from a CDN. Try it minipx.com — would love your feedback. What features would you want added?