Every GIF tool I tried wanted the same three things: upload your file to their server, create an account, and accept a watermark on the way out.

So I built GIFCove the opposite way: a small set of GIF tools where everything happens on the visitor's own device. No file ever touches a server - which means no upload wait, no storage cost, and nothing private leaving the user's machine. Here's how the three hardest tools work.

1. The Downloader: beating CORS with a fallback chain

The GIF downloader takes a link from Giphy, Tenor, Reddit, Tumblr, Pinterest or X and returns the original GIF file. Each platform behaves differently:

  • Giphy is the easy one - the media ID in the URL maps straight to the file.
  • The rest block cross-origin fetches, so the tool walks a chain of public CORS proxies and uses the first one that answers in time (each gets a hard timeout, ~9 seconds).
  • Last resort: fetch the page's og:image meta tag, which almost every platform sets to the GIF itself for sharing previews.
async function fetchViaChain(url, sources) { for (const makeUrl of sources) { try { const res = await fetchWithTimeout(makeUrl(url), 9000); if (res.ok) return res; } catch (e) { /* try the next source */ } } throw new Error('All sources failed'); } 

One honest detail: if a Reddit post turns out to be an MP4 video rather than a GIF, the tool says so plainly instead of handing back a broken "GIF".

2. Frame work: decode, draw, re-encode

The combiner and resizer tools share one engine: decode the GIF into individual frames, draw each frame onto a <canvas> at the right offset (GIF frames are often partial, so disposal methods matter), do the edit, then re-encode - inside a Web Worker, so a 200-frame GIF doesn't freeze the page.

3. Background removal: color keying, per frame

The background remover works like a tiny green-screen studio:

  1. Sample the corner pixels to auto-detect the background color.
  2. For every pixel in every frame, measure its color distance from that key color and fade the alpha accordingly.
  3. Despill - remove the color fringe the key leaves on edges.
  4. Flood-fill protection - if the subject itself touches the key color (a white cat on a white background), protect connected subject regions so the tool doesn't eat the subject.

And one deliberate limitation: it only accepts flat white, green or black backgrounds. Anything else gets a clear "not supported" message up front. I'd rather refuse a file than return a chewed-up result and pretend it worked.

The trade-offs of zero backend

  • The user's CPU does the work - a huge GIF on a weak phone is slow. Progress bars and worker-based processing are not optional.
  • Memory is the ceiling - decoded frames are raw bitmaps; a long GIF can eat hundreds of MB.
  • In exchange: hosting costs almost nothing, there is no upload queue at peak times, and "we never see your files" is not a policy promise - it's an architectural fact.

If you build browser-side tools: where do you draw the line? At what file size or processing time do you give up and send the work to a server?