What is a GIF?

Capped at 256 colours, compresses badly, and has been technically obsolete for a decade — yet it remains culturally unavoidable. Both halves of that are worth understanding.

GIF at a glance

Extension
.gif
Introduced
1987 by CompuServe; the GIF89a revision added animation in 1989.
Compression
LZW — lossless, but only after reducing to 256 colours.
Colours
256 per frame, from a palette. Photographs suffer badly.
Transparency
Binary only. Fully opaque or fully invisible, hence jagged edges.
Animation
Yes — its one enduring advantage, and the reason it survives.
vs animated WebP
GIF is frequently several times larger for worse quality.
On this site
Not supported — a canvas would silently keep only the first frame.

Understanding GIF

Why it looks the way it does

GIF stores at most 256 colours per frame, chosen from a palette. Its LZW compression is lossless, but only after the image has been reduced to that palette — and that reduction is where the damage happens.

A photograph contains far more than 256 distinct colours, so converting it means quantising: picking a representative palette and mapping every pixel to the nearest entry. Gradients become bands, and encoders add dithering — deliberate noise — to disguise it, which is why old GIF photographs have that characteristic speckled look.

For flat graphics with few colours it works perfectly, which is what it was designed for in 1987.

Binary transparency and the jagged edge

GIF supports transparency, but only as a single flag: each pixel is fully opaque or fully invisible. There is no partial opacity.

That makes smooth anti-aliased edges impossible. A curved logo has to choose, pixel by pixel, between drawn and not drawn, which produces the stair-stepped outline familiar from 1990s web design.

PNG's 8-bit alpha channel exists precisely to solve this, and WebP inherits it. If you need transparency, GIF is the wrong answer.

Animation, and why it is so inefficient

Animated GIF stores a sequence of frames, each subject to the 256-colour limit. There is inter-frame optimisation — storing only changed regions — but nothing resembling the motion prediction any video codec uses.

The result is enormous. A few seconds of animation routinely runs to several megabytes, where the same clip as animated WebP or a short MP4 might be a tenth of that with full colour.

Worth knowing: most "GIFs" on social platforms today are not GIFs at all. The platforms convert uploads to MP4 or WebM and keep the label, because the format is culturally entrenched while the technology is not.

What to use instead

Short animation on the web
Animated WebP — full colour, alpha, and a fraction of the size.
Longer or higher-quality motion
MP4 or WebM video with autoplay, loop and muted attributes.
Still graphics and logos
PNG, or SVG if it is made of shapes.
Still photographs
JPEG or WebP. A photographic GIF is always the wrong choice.
Genuine reasons to keep GIF
Email clients, which support animated GIF far more reliably than anything modern; and contexts where a platform expects the format specifically.

Why there is no GIF tool here

A browser canvas decodes only the first frame of an animated GIF. A "GIF compressor" built on canvas would therefore accept your animation and hand back a single still image — technically a smaller file, and a completely destroyed one.

Genuine GIF support requires decoding every frame, managing the palette, handling frame disposal and re-encoding the sequence. That is a real library, not a canvas call, and rather than ship something that silently discards your animation there is no GIF tool here.

For converting an existing GIF library, ffmpeg or gifsicle are the tools that do it properly.

Try it yourself

Everything below runs in your browser, so you can test any of this on your own files without uploading them.

  • Compress PNG

    Lossless by default, with transparency carried through untouched.

    Open the tool
  • Compress WebP

    Re-encode existing WebP files, or convert JPEG and PNG into WebP.

    Open the tool
  • Compress JPEG

    Shrink JPG and JPEG photographs with a quality slider or an exact target size.

    Open the tool
  • PNG to JPG

    For photographs stored in the wrong container. Transparency is flattened deliberately.

    Open the tool

Questions

Frequently asked questions

Every answer below is present in the page source, expanded, so it can be read without opening anything.

Why are GIF files so large?

Because there is no motion prediction between frames — each is essentially stored separately, subject to a 256-colour palette. Modern codecs describe what changed between frames instead, which is why an animated WebP or a short MP4 can be a tenth of the size.

Can GIF store more than 256 colours?

Not per frame. There are obscure tricks using multiple frames with different palettes, but nothing that works reliably. If you need full colour, use PNG for stills or WebP for animation.

Why does my transparent GIF have jagged edges?

GIF transparency is binary — a pixel is either fully visible or fully invisible, with no partial opacity. Anti-aliased edges cannot be represented. PNG and WebP both offer 256 levels of transparency and handle soft edges properly.

Should I still use GIF?

Rarely. Animated WebP or a short video is better in almost every measurable way. The genuine exceptions are email, where GIF animation support is far more reliable than anything modern, and platforms that specifically expect the format.

Are the GIFs on social media really GIFs?

Usually not. Most platforms convert uploads to MP4 or WebM while keeping the name, because the word is culturally entrenched even though the format is not. That is why they look better and load faster than a real GIF would.

Can I compress a GIF here?

No. A browser canvas only decodes the first frame, so a tool built that way would silently destroy your animation and return a still image. Use gifsicle or ffmpeg, which handle frames and palettes properly.

From the blog

Related reading

Longer, more practical guides from the blog.

  • Image Formats

    PNG vs JPEG: When to Use Each, With the File Sizes to Prove It

    PNG stored the same photograph in 1274.1 KB where JPEG needed 67.5 KB — nineteen times larger. On a flat graphic PNG won. On a smooth gradient PNG lost to JPEG by a factor of two, which surprises most people.

    9 min read

  • Image Formats

    WebP vs JPEG: Which Should You Use, and When JPEG Still Wins

    WebP produced a 27.0 KB file against MozJPEG's 41.1 KB on the same photograph at slightly higher measured fidelity — 34% smaller. It also produced a larger file than JPEG on random noise. The advantage is real and content-dependent.

    9 min read

  • Practical Guides

    How to Compress Images for a Website Without Wrecking Them

    Resize before you compress. Measured on one photograph: half the width at quality 80 produced a 16.4 KB file, while full width at quality 40 produced 20.6 KB and looked far worse. The order of operations matters more than the settings.

    8 min read