DEV Community

Saurabh Sharma
Saurabh Sharma

Posted on

I built a GIF compressor that runs 100% in your browser (because Discord's file limits are the worst)

If you've ever tried to upload a GIF as a Discord emoji, you know the drill. Discord wants it under 256KB, your export is 4MB, and now you're bouncing between three different "free" online converters. One of them gates batch processing. Another caps how many files you can run per day. Another quietly uploads your file to a server you never agreed to.

I got tired of that loop, so I built CompressGIFs. It's a small GIF toolkit that runs entirely in your browser. No upload, no account, no daily cap.

Here's what it does and why I built it this way.

The actual problem

"Compress a GIF" sounds like a solved problem. It isn't, once you look at what people actually need:

  • Discord emoji: 256KB, 128×128
  • Discord stickers: their own size and format quirks
  • Slack emoji, WhatsApp stickers, Telegram stickers: all different limits
  • And the universal one: "just make this smaller, I don't care about the settings, I just need it to work"

Every tool I tried made me guess. Drag a quality slider, export, check the file size, repeat until it's small enough. That's a bad experience for something that should be simple. I already know my target size. The tool should just get me there.

What's different here

1. You tell it the target size and it finds the settings for you.

Instead of a lossy quality slider, you type "under 256KB" or pick a Discord, Slack, WhatsApp, or Telegram preset. The tool then runs a binary search across compression parameters until the output lands under your target:

  1. Binary search gifsicle's --lossy value (1 to 200)
  2. Still too big? Binary search --colors (256 down to a floor)
  3. Still too big? Fall back to proportional downscaling, step by step

This runs inside a Web Worker so the tab doesn't freeze while it's working. Some of these searches take a few seconds on bigger files, and you actually see live progress instead of a frozen screen.

2. It's genuinely client-side.

The compression engine is gifsicle compiled to WASM, running right in your browser. Your GIF never touches a server. That's not just a privacy checkbox I'm ticking. It's also the reason the next point is even possible.

3. Batch processing isn't a paywall.

I checked what the big converters actually offer on their free tiers. One well-known one caps you at 10 conversions a day and a 5-file batch limit. Batch processing is literally their paid upsell. That makes sense when you're paying for server compute per file. It doesn't make sense here, because there's no server doing the work. Your own machine is. So batch is just unlimited. Drop in a folder of 40 GIFs, walk away, come back to 40 compressed files.

4. A compliance checker, not just a compressor.

This is honestly the tool I wanted most for myself. Upload a GIF, pick "Discord Sticker" or "Slack Emoji," and get a clear pass or fail on size, dimensions, and format all together, with a specific note on what to fix if it fails. If you moderate a Discord server, this is the kind of thing you pin in your assets channel so people stop asking why their upload keeps getting rejected.

Why not just build "one more compress gif page"

Before writing any code, I looked at who actually ranks for these terms. The space is dominated by a 13 year old incumbent with hundreds of interlinked tool pages and real domain authority. That's not something a single new landing page beats just by looking nicer. So instead of chasing the generic "compress gif" term head on, I scoped this narrower and deeper. A full GIF workflow: compress, resize, convert, and validate against platform limits, with the Discord specific tools front and center, since that's the highest intent, most underserved corner of this whole space right now.

Stack, if you're curious

  • Astro (static, zero backend)
  • gifsicle-wasm-browser for the actual compression, lazy loaded so it doesn't bloat the initial page weight
  • Web Workers for the target size search loop
  • Cloudflare Pages for hosting

No database, no API, no account system. Just static files and WASM running on your CPU.

Try it

compressgifs.com. Free, no signup, nothing leaves your browser.

If you run a Discord server, the Discord compliance checker is worth a look on its own. It's the tool I wish had existed before I spent an entire afternoon manually re-exporting stickers at four different sizes.

Would genuinely love feedback from this crowd, especially if you hit an edge case where the target size search doesn't converge. That's the part I'm most paranoid about getting wrong.

Top comments (0)