GIF Compressor
Published Updated
Choose a quality preset, color palette size, and resolution scale, then compress your animated GIF and download the result — free, private, and processed entirely in your browser.
Every frame stays, the palette and the canvas shrink
This compressor never drops frames. It decodes your GIF into full frames, optionally scales each one down, rebuilds a single shared Palette. A table of colors that an indexed image points into. In a GIF each pixel is a number from 0 to 255, and the palette says which of up to 256 colors that number stands for. Read the guide with fewer colors and writes the GIF again. Frame delays are kept. That makes the result predictable: same motion, fewer pixels or colors.
The three presets are shortcuts for two settings, and each button lists the two values it sets. You can change either afterwards.
What the presets set
| Preset | Colors | Resolution | When to use it |
|---|---|---|---|
| Best quality | 256 (most) | 100% | A baseline. Nothing is reduced on purpose, though colors can still shift. |
| Medium | 128 | 100% | First try. Often enough for flat or cartoon content. |
| High Compression | 64 | 75% | When you need a clearly smaller file and can lose some sharpness. |
The colors menu offers 256, 128, 64 and 32. The resolution slider runs from 10% to 100% in steps of 5. The 75% preset keeps about 56% of the pixels, and 50% keeps 25%.
How much a setting can save
Size depends on pixels times frames, and on how well each frame compresses. The measured table further down runs two test GIFs through eight settings.
A practical order: lower the resolution first, because it removes pixels from every frame, then reduce colors until banding appears, and stop there.
Frames you can load, by canvas size
The decoder keeps every frame in memory as 4 bytes per pixel and stops at 500 MB (counted as 500 × 1,048,576 bytes) or at 1,000 frames, whichever comes first.
| Canvas | Memory per frame | Frames before the 500 MB stop |
|---|---|---|
| 480 × 270 | 0.5 MB | 1,000 (the frame cap applies first) |
| 640 × 360 | 0.9 MB | 568 |
| 1280 × 720 | 3.7 MB | 142 |
| 1920 × 1080 | 8.3 MB | 63 |
Why no preset is lossless
Every run rebuilds the palette: up to 20,000 sampled pixels from all frames go into one shared table of at most 256 colors, and each pixel is matched to it through a lookup with 32 levels per channel. Test GIFs were written with exact palettes by Pillow and run through the tool's own decoder and encoder at 256 colors and 100%:
| Test GIF | Colors in | Colors out | Pixels changed |
|---|---|---|---|
| 8 flat colors, 6 frames | 8 | 8 | none |
| Two greys 3 levels apart | 2 | 1 | 50% |
| Grey ramp, all 256 levels | 256 | 32 | 87.5% |
| 4 frames, each with its own 256-color palette | 1,024 | 254 | 75.4% |
Flat artwork with few colors survives intact. Smooth gradients and GIFs that use a different palette per frame lose shades even on the best setting.
How a GIF stores frames, and why a rebuild can cost bytes
In a GIF every frame carries its own position and size inside the canvas, and its pixels are stored as indexes into a colour table of at most 256 entries, packed with LZW codes of up to 12 bits (GIF89a specification). That position field is what lets an optimiser store only the rectangle that changed from the previous frame. A frame may also bring a local colour table instead of using the shared global one.
This tool does none of that. For every frame it writes a full-canvas image from the corner (0, 0) with the whole width and height, uses one global palette, and sets the frame to be cleared before the next one. So the output size follows the number of pixels, the number of colours and the busyness of the picture, and not how the original was written. A GIF that was already optimised can therefore come out larger.
Measured: two test GIFs through eight settings
Two animations of 480 × 270 pixels were written with Pillow 11.3.0, which stores only the changed rectangle of each frame. The first has 40 frames of a smooth gradient background, a few flat shapes and one moving ball. The second has 20 frames of a grainy texture that pans, so nearly every pixel changes. Each file was run through this tool's own decoder, scaling step and encoder in Chromium 152, with the settings below. Sizes are decimal, and the figure in brackets is the new size divided by the original.
| Setting | Gradient and ball, 40 frames (original 76 KB) | Grainy pan, 20 frames (original 2.86 MB) |
|---|---|---|
| Best quality: 256 colors, 100% | 312 KB (4.1 times) | 1.51 MB (0.53 times) |
| Medium: 128 colors, 100% | 307 KB (4.1 times) | 1.49 MB (0.52 times) |
| High Compression: 64 colors, 75% | 141 KB (1.9 times) | 714 KB (0.25 times) |
| 64 colors only, 100% | 259 KB (3.4 times) | 1.43 MB (0.50 times) |
| 32 colors only, 100% | 179 KB (2.4 times) | 1.13 MB (0.40 times) |
| 75% size only, 256 colors | 241 KB (3.2 times) | 764 KB (0.27 times) |
| 50% size only, 256 colors | 143 KB (1.9 times) | 321 KB (0.11 times) |
| 32 colors and 50% size | 84 KB (1.1 times) | 234 KB (0.08 times) |
The same tool shrank one file to 8% and made the other 4 times larger, so the result card matters more than any preset name. The gradient clip never fell below its original, even at 32 colors and half size. The grainy clip was already about half its size at Best quality. In both, going from 256 to 128 colors saved under 2%, while halving the width and height saved 54% and 79%, so the resolution slider is the stronger control. Repeated runs at 100% gave exactly the same sizes, but the scaled runs differed by up to about 2.5% between two passes.
Compressing a GIF
Step 1
Add an animated GIF
The page reads every frame first and shows the pixel size, frame count and file size.
Step 2
Pick a preset, then adjust
Best quality, Medium or High Compression set the colors and scale for you. The colors menu and the resolution slider can override them.
Step 3
Compress and compare
The result card prints original and new size, and a saving only if the file shrank. Download the -compressed.gif file.
What this tool leaves out
If you need to reach an exact byte limit rather than choose settings, try Compress GIF to Size. This tool does not store only the changed region between frames, so it cannot match a dedicated GIF optimiser on footage with a still background. Transparent pixels are all-or-nothing, and the loop count of the source is not preserved.
If the GIF is only going on a web page, a video is usually far smaller. In web.dev's own example, the same animation was 3.7 MB as a GIF, 551 KB as MP4 and 341 KB as WebM (web.dev). GIF to MP4 makes that conversion.
GIF compressor questions
Why did my GIF get bigger after compressing?
The tool rewrites every frame as a full-size image. A GIF that was already optimised to store only the changed part of each frame can grow when it is rebuilt, especially on the Best quality preset. The result card only reports a saving when the new file is smaller.
Is the Best quality preset lossless?
No, and none of the presets is. Best quality asks for 256 colors at 100% size, but the GIF is still decoded and encoded again with one new shared palette. In tests, an 8-color animation came back pixel for pixel, while a 256-step grey ramp came back with 32 greys. Dimensions, frame count and frame delays stay the same.
Does it remove frames?
No. Every frame is kept, with its delay. To shrink a long GIF you have to reduce colors or resolution, or use Compress GIF to Size to aim for a byte limit.
Why does it refuse my GIF?
It stops at 1,000 frames, at 10,000 pixels on either side, and when the decoded frames would need more than 500 MB of memory. The error message names which limit was hit.
Will the GIF still loop?
It will loop forever. The output always carries an infinite-loop setting, so a GIF that played once will now repeat.
Which preset should I use for a screen recording with a still background?
Check the result card first, because these are the files most likely to grow. A 76 KB test GIF with a still gradient background and one moving ball came out 4.1 times larger at Best quality and was still larger at 32 colors and half size. If the card shows no saving, keep the original or turn it into an MP4.
Why does 128 colors save so little over 256?
In two test GIFs, 128 colors came out under 2% smaller than 256. Dropping to 64 saved 17% on one and 5% on the other, and 32 colors saved 43% and 25%. For a bigger saving, lower the resolution first: halving width and height saved 54% and 79%.
Why is the size slightly different each time I compress?
Scaled runs can vary a little. In a test, repeating the same two scaled settings (64 colors at 75%, and 32 colors at 50%) on both files gave sizes up to about 2.5% apart, while runs at 100% gave exactly the same size both times. If you are aiming at a limit, leave a few percent of margin.
Related guide
Making a GIF from a video: size, frame rate and quality. The guide measures what fewer colors and a smaller canvas each save, and why the palette cut is gentler on flat artwork.