Back to Blog
general

GIF to Animated WebP: Smaller Files, Same Animation

A reaction GIF that weighs several megabytes can usually ship as an animated WebP at a fraction of the size, with identical frames and timing. Here's how to convert it with gif2webp, ImageMagick or online, and where animated WebP still gets rejected.

Rumen AtanasovNovember 22, 20267 min read

You dropped a looping product demo or a reaction meme into a landing page, and the network tab says it costs more than the rest of the page combined. That's normal: an animated GIF is a 1987 format wearing a 2025 job. The fix is usually one conversion away. Moving from GIF to WebP keeps every frame, every delay and the loop count, while typically cutting the file to a small fraction of the original.

This article shows what the savings actually look like on a typical reaction GIF, how to run the conversion from the command line or in the browser, and the two places where animated WebP still gets refused so you don't ship a broken email campaign.

Why your animated GIF is too large

GIF has three structural problems that no amount of "optimising" fully solves:

  • 256 colours per frame. Anything with gradients, video footage or skin tones has to be dithered, and dither noise is expensive to compress.
  • LZW compression. It predates modern entropy coding and the predictive techniques used by video and WebP.
  • Crude frame reuse. GIF can only skip unchanged rectangles; it cannot predict a frame from the previous one the way WebP's inter-frame coding does.

Animated WebP fixes all three: full 24-bit colour with alpha, VP8/VP8L compression, and real frame prediction. That's why the animated WebP vs GIF size comparison is rarely close.

What the savings look like on a real reaction GIF

Take a typical 480×270 reaction GIF — call it reaction-dog.gif, 64 frames, around 4 MB. Converting it with default lossy settings commonly lands somewhere in the few-hundred-kilobyte range, and the animation plays identically. On flat-colour, illustration-style GIFs (UI demos, logo loops) even lossless WebP usually beats the GIF, because WebP's lossless mode is simply a better codec than LZW.

Rules of thumb that hold up across most source material:

  • Video-derived GIFs (screen recordings, film clips, memes): lossy WebP gives the biggest wins, often an order of magnitude.
  • Flat graphics and line art: use lossless WebP; you keep pixel-perfect edges and still shrink the file.
  • Short loops under 20 frames: savings are smaller in absolute terms, but still worth it on a hero section.

Always measure your own file rather than trusting a headline number — compression depends entirely on content.

Frame timing is preserved (check it, don't assume)

The common worry is that conversion will speed up or stutter the animation. Animated WebP stores a per-frame duration and a loop count, exactly like GIF, so a faithful converter copies them over frame by frame — including variable delays, where one frame holds for 1.5 s and the rest run at 40 ms.

Two caveats worth knowing:

  • GIF delays are stored in hundredths of a second, and many browsers silently bump delays below 20 ms up to 100 ms. WebP stores milliseconds, so a converted file can look more correct than the original — occasionally meaning slightly slower than you remembered.
  • GIF's binary on/off transparency becomes true alpha in WebP. Edges against a coloured background usually look cleaner, not worse.

Verify with webpmux -info reaction-dog.webp, which lists every frame with its duration, offsets and blending method.

Hands-on: converting GIF to WebP

Pick whichever route fits your workflow — the output is the same format either way.

Command line with gif2webp

gif2webp ships with Google's libwebp tools (brew install webp, apt install webp, or the official binaries on Windows). The purpose-built converter is the one to reach for because it understands GIF frame disposal.

# balanced default: lossy, max compression effort
gif2webp -q 75 -m 6 -mt reaction-dog.gif -o reaction-dog.webp

# squeeze harder for a meme where artefacts don't matter
gif2webp -lossy -q 55 -m 6 reaction-dog.gif -o reaction-dog.webp

# flat graphics, UI recordings, logos
gif2webp -lossless -m 6 ui-demo.gif -o ui-demo.webp

# inspect frames, durations and loop count
webpmux -info reaction-dog.webp

-q is quality (0–100), -m 6 is the slowest/best compression method, -mt enables multithreading. Start at -q 75 and walk down until you see banding on a paused frame.

ImageMagick, if it's already in your pipeline

magick reaction-dog.gif -coalesce -layers optimize \
  -quality 75 -define webp:method=6 reaction-dog.webp

-coalesce rebuilds each frame as a full image first, which avoids ghosting artefacts from GIF disposal methods. ImageMagick is convenient for batch jobs, but for a single hero animation gif2webp generally produces a smaller file.

The browser route, no install required

If you're a marketer handing assets to a developer — or just don't want Homebrew on your laptop — convert the file with the GIF to WebP converter. Drop in reaction-dog.gif, download the animated WebP, compare the two sizes in Finder or Explorer. Other formats live in the same image converter hub if you also need a PNG or JPEG still for social previews.

Where animated WebP is still refused

Every current browser plays animated WebP, so for websites it's safe. Two environments are not browsers:

  • Email clients. Support is patchy to non-existent, and Outlook on Windows doesn't even animate GIFs — it shows the first frame. Keep GIF (or a static image plus a link) for email, and design the first frame so it works standing still.
  • Chat and social apps. Some accept animated WebP, some re-encode it, some strip the animation and leave a still. Older CMS media libraries and desktop tools may reject the MIME type outright.

On the web, you don't have to choose. Serve WebP with a GIF fallback:

<picture>
  <source srcset="reaction-dog.webp" type="image/webp">
  <img src="reaction-dog.gif" alt="Dog knocking a cup off a table"
       width="480" height="270" loading="lazy">
</picture>

And if the animation is long, silent footage rather than a short loop, consider a muted autoplay MP4/WebM <video> — below a few seconds WebP usually wins on simplicity; above that, video codecs pull ahead.

A five-minute workflow you can reuse

  1. Find the heaviest animation on the page in DevTools → Network, sorted by size.
  2. Run gif2webp -q 75 -m 6 -mt source.gif -o source.webp (or convert it online).
  3. Check frames and delays with webpmux -info, and eyeball one paused frame for banding.
  4. If it's still over ~500 KB, drop -q to 60 and re-check; if it's flat artwork, switch to -lossless.
  5. Ship it inside <picture> with the GIF as fallback, and add width/height to prevent layout shift.
  6. Keep the original GIF for email and for any platform that rejects WebP.

One conversion, same animation, a page that stops costing megabytes.

FAQ

Does converting GIF to WebP lose quality? Lossy mode re-encodes each frame, so very high-contrast edges can soften slightly at low quality settings. Use -lossless for graphics and -q 75 or above for footage and most people will never spot a difference — especially since GIF already threw away colour down to 256 shades.

Will the animation still loop forever? Yes. The loop count is carried across; an infinitely looping GIF becomes an infinitely looping WebP.

Can I convert animated WebP back to GIF? Yes, with anim_dump plus ImageMagick, or an online converter — but you'll get GIF's 256-colour palette back, so treat the WebP as a derivative and archive the original.

Is WebP better than MP4 for animation? For short UI loops and memes, WebP is simpler: it behaves like an image, works in <img>, and needs no player controls or autoplay policies. For clips longer than a few seconds, a muted MP4 or WebM is usually smaller.

Does Google care? Indirectly. Smaller animations improve Largest Contentful Paint and overall page weight, both of which feed into Core Web Vitals and mobile experience.

Ready to Convert Your Files?

Try our free online file converter. No registration required.

Start Converting