Updated November 2026 · 3 min read

GIF, WebP, APNG,
and Which to Use.

GIF dates from 1987, is capped at 256 colors, and is still the default for a looping clip. WebP and APNG hold full color and work in every current browser. Each one fits a different place.

GIF colors 256 Sample as GIF 110 KB Same frames as WebP 82 KB GitHub takes GIF and MP4

The Formats, Measured

FormatColorsAlphaThe Sample
GIF256 per frame1 bit, on or off110 KB
WebPFull 24 bit8 bit, smooth82 KB lossless, 173 KB lossy
APNGFull 24 bit8 bit, smooth96 KB
MP4 (H.264)Full 24 bitNone294 KB at 1280 × 720

The sample is a 4.2 second screen recording of an invoicing app, made in the GIF Maker at 600 × 338 and 15 frames a second. The GIF is its Email export. The lossless WebP and the APNG hold the same frames as the GIF, pixel for pixel. The lossy WebP is quality 75, made from the full color video. The MP4 is Turn Into MP4 at 720p, the smallest size it offers.

The WebP files were made with Google’s libwebp tools. The APNG was made with each frame cropped to what changed, the way the GIF is.

On a screen recording of flat interface color, the image formats land close together, because each frame only redraws what changed. A gradient or camera video is where GIF falls behind: 256 colors cannot describe a gradient, so the encoder has to dither, and the noise that adds compresses badly.

The sample as a GIF: the Billwren invoices page, then Settings, where dark mode turns on, with captions
GIF, 600 × 338, 110 KB
MP4, 1280 × 720, 294 KB

Why GIF Banding Happens

A GIF holds a palette of at most 256 colors per frame. Encoding picks the best 256 for your clip and maps every pixel to the nearest one. On a photograph or a gradient the nearest is often visibly wrong, which is the banding you see.

Dithering scatters the error across neighboring pixels so the eye averages it out. It looks better, and it makes the file larger, because the noise breaks up the repeated patterns that GIF’s LZW compression relies on. That trade is one of the biggest levers on GIF file size.

Compatibility in 2026

Animated WebP works in every current browser and in most messaging apps. It fails in older desktop image viewers and in some email clients.

APNG works in every current browser too. Software that does not understand the animation shows the first frame as a normal PNG.

GIF works everywhere, which is the main reason to still use it. If the clip is going into a README, a support ticket, an older chat client, or an email, GIF is the safe choice.

GitHub takes GIF and MP4 but not WebP or APNG. Its file types for issues, pull requests, and comments are PNG, GIF, JPEG, SVG, MP4, MOV, and WebM, with images and GIFs up to 10 MB (GitHub Docs).

When to Use a Video Instead

Past about 10 seconds, or with camera video in it, a GIF is the wrong tool. A video codec reuses earlier frames and stores only what changes, in full color. In web.dev’s example, a 3.7 MB GIF became a 551 KB MP4. On a short screen recording the gap is small: the sample’s MP4 is 294 KB against the GIF’s 110 KB, with more than four times the pixels.

The cost is that video needs a player and does not autoplay everywhere. On the web, a muted, looping, inline <video> autoplays in every browser and behaves like an animated image.

<video autoplay loop muted playsinline>
  <source src="demo.mp4" type="video/mp4">
</video>

All four attributes matter. Without muted and playsinline, iOS Safari refuses to autoplay and opens the video fullscreen instead.

Getting the Size Down

In order of how much they save for how little they cost, with the GIF Maker control for each:

A Rule of Thumb

README, issue, chat, or email: GIF, under about 10 seconds. A web page you control: an MP4 in a muted, looping video, or WebP if it has to be an image. A short animation that needs smooth see-through edges: APNG. Anything longer, or anything with camera video in it: MP4.