GIF guide
Remove Background From a GIF Without Losing the Animation
A practical walkthrough for making a transparent GIF: what the tolerance slider really does, why frames smear, and the size limits that decide whether Discord or Twitch will accept the file.
Updated 2026-11-25
A transparent GIF is one of those files that looks simple until you try to make one. The background has to disappear on every frame, the loop has to stay stable, and the result still has to fit inside a platform's size limit. This guide covers the whole job: the quick method, the parts that usually go wrong, and the checks worth doing before you upload.
If you just want the file, open the GIF background remover, drop your animation, and raise the tolerance until the backdrop disappears. The rest of this page explains what the controls are doing so you can fix a cut that comes out wrong.
The short version
- Load the GIF. Every frame is decoded, not just the first one.
- Sample the background colour from a clean patch near the edge.
- Raise Tolerance until the backdrop is gone, then stop. Around 20–35 handles most compressed GIFs.
- Keep Only remove connected background on when the subject contains the same colour as the backdrop.
- Add a little Edge softness if the cut looks hard, and leave Clean colour spill on for hair or thin type.
- Pick an output width that matches the destination, export, and check the file size.
That is enough for a green screen clip, a logo on a white sweep, or a product shot with a flat backdrop. The hard cases are below.
Why GIF transparency is only one bit
PNG and WebP store an alpha channel with 256 levels per pixel. GIF does not. It stores a palette of up to 256 colours and one index can be marked as transparent. A pixel either uses that index or it does not.
This has three consequences:
- Soft edges cannot survive as soft edges. The preview can show a gradual ramp, and a PNG export can keep it, but the GIF encoder has to decide whether each edge pixel is inside or outside. That is why a cut that looks smooth in the browser can look jagged after export.
- Transparent pixels still consume a palette slot. A GIF with transparency has 255 usable colours, not 256.
- Anti-aliasing works against you. The semi-transparent fringe around a subject often contains a blend of subject and background colour. If it is kept, you see a halo; if it is dropped, the edge looks hard. Colour spill cleanup is the compromise: it subtracts the background tint from partially transparent pixels before the final threshold.
None of this means GIF is the wrong format. It is still the most reliable way to get an animation to play automatically in Discord, Slack, chat embeds and older email clients. It just means the export needs a little care.
Frame disposal is why backgrounds smear
A GIF is not a sequence of full screenshots. Each frame can store only the rectangle that changed, and a Graphics Control Extension tells the decoder what to do with the previous frame:
| Disposal | What the decoder should do | What it means for a cutout |
|---|---|---|
| 0 or 1 | Leave the previous frame in place | The new frame draws on top; unchanged pixels persist. |
| 2 | Restore the frame area to the background | The area is cleared, which usually means transparent in a browser. |
| 3 | Restore the area to what was there before | The decoder has to keep a snapshot of the previous state. |
If a tool ignores disposal and simply pastes each frame's rectangle onto a canvas, two things happen. Areas that should have been cleared keep old pixels, and areas that should have persisted turn into holes. On a transparent export, that shows up as flicker, ghost trails, or a subject that partially disappears on some frames.
The bench on the home page composites each frame with its declared disposal method before keying anything. It also keeps the original frame delays, so the exported loop runs at roughly the same speed as the source.
What each control does
Background colour
The tool samples the border of the first frame and picks the most common colour. That is usually right for a flat backdrop. If the subject touches the edge, the sample can land on the subject instead. Use Pick from image and click a clean patch of background.
For a green screen, sample the green rather than pure chroma-key green from a colour picker. Compressed GIFs rarely keep the backdrop perfectly uniform, and the sampled value is closer to what is actually in the file.
Tolerance
Tolerance is the radius around the background colour that counts as background. Raise it until the backdrop disappears. Going further starts eating into the subject, especially skin tones, white product surfaces, and anything that shares hue with the backdrop.
A useful test: find the darkest corner of the backdrop and the lightest part of the subject. If they are close in colour, a colour key alone will struggle; that is a job for the AI matte.
Only remove connected background
Colour matching alone asks “is this pixel close to the background colour?” Connected-only asks a better question: “can this pixel be reached from the border without crossing an opaque edge?”
That distinction saves white shirts on white walls, green logos on green screens, and product labels that happen to match the backdrop. The flood fill starts at the image border and spreads through matching pixels. Interior regions keep their colour even when they match exactly.
It is not magic. If the subject touches the background with no visual separation, the flood leaks through the contact point. Crop tighter, add a shadow, or switch to the AI cutout.
Edge softness
Softness widens the transition between opaque and transparent. In the preview it makes a hard cut look more natural. In a PNG export it is real alpha. In a GIF export it changes which side of the threshold the edge pixels land on, which can reduce jaggies but cannot create smooth alpha.
Start low. Too much softness makes thin details, such as hair strands and text strokes, fade away.
Colour spill
When a subject is photographed against green, the edge pixels pick up green light. After keying, that contamination remains as a green fringe. Spill cleanup subtracts the background colour from partially transparent pixels in proportion to their transparency.
It helps most on hair, fur, grass and thin type. It does nothing for a hard, fully opaque edge; there is no partial pixel to correct.
Platform size limits that actually matter
These are the limits people hit most often. Check the current platform documentation before a big campaign, because the numbers do change.
| Destination | Recommended size | File limit | Notes |
|---|---|---|---|
| Discord custom emoji | 128×128 | 256 KB | Animated emoji need Nitro to use, but anyone can upload them to a server. |
| Discord sticker | 320×320 | 512 KB | Stickers are a separate upload type from emoji. |
| Twitch emote | 112×112, 56×56, 28×28 | 1 MB each | Animated emotes require Affiliate or Partner status. |
| Slack emoji | 128×128 | 128 KB | Slack re-encodes large images; transparency is preserved. |
| Telegram sticker | 512×512 | 512 KB | Telegram prefers WebP or PNG for stills; animated stickers use a different format. |
| Shopify product section | 480–800 px wide | Keep under 2 MB | A transparent GIF on a coloured section reads as motion without a visible rectangle. |
| Email signature or campaign | 320–480 px wide | Under 1 MB | Email clients handle GIF transparency inconsistently; test before sending. |
The practical move is to export at the smallest width that still looks sharp on the target. A 480 px GIF scaled down by Discord looks better than a 1280 px GIF that gets rejected for size.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| White or green halo around the subject | Background colour is mixed into edge pixels | Turn on colour spill cleanup; increase edge softness slightly; sample the backdrop again. |
| Jagged, stair-stepped edges | GIF's one-bit alpha | Export a PNG for smooth edges, or accept the jaggies at small sizes where they are less visible. |
| Holes inside the subject | Colour matching hit an interior region that matches the backdrop | Turn on connected-only removal; lower tolerance. |
| Background flickers between frames | Disposal method ignored, or the backdrop colour shifts per frame | Use a tool that composites disposal correctly; sample from a middle frame, not only the first. |
| Subject disappears on some frames | The AI matte was reused across a moving camera | Run the AI pass on each frame, or cut only the frames where the subject stays in the same silhouette. |
| File is too large | Too many frames, too wide, or a noisy palette | Lower the output width, cut the frame count, or simplify the background before exporting. |
| Colours shimmer or band | Per-frame palettes | Use a shared palette across frames; the bench does this by default. |
When a colour key is not enough
Photographic backgrounds are the limit case: a street, a bedroom, a textured wall, a gradient studio sweep. There is no single colour to remove, and raising tolerance far enough to catch the wall will destroy the subject.
That is what the AI GIF background remover path is for. It sends one still frame to a matting model and returns a soft-alpha PNG. You can download that PNG, or apply the returned matte to every frame when the camera is locked off. For a moving camera, run the model on the frames you actually need instead of propagating one silhouette across the whole loop.
The free bench stays free because it never leaves your browser. The AI path costs credits because it runs on a server and calls a paid model. Both end in the same place: a transparent file you can upload.
A pre-upload checklist
- Open the exported GIF in a different app from the one you made it in. A browser preview is not the same decoder as Discord.
- Check the first and last frame. A loop that jumps is usually a disposal problem, not a colour problem.
- Confirm the file size against the destination limit.
- Look at the edges on a mid-tone background, not only on white. Halos hide on white.
- Keep the original GIF. Re-exporting a transparent GIF adds another round of palette loss.
If the cut is clean and the loop is stable, stop there. More tolerance is not better; it is just more of the subject removed.
Questions people ask
Can a GIF have a truly transparent background?
Yes, but only one-bit transparency. Every pixel is either fully opaque or fully transparent; there is no partial alpha in the GIF format. Soft edges exist in the preview and in PNG export, then get rounded to one side when the GIF is encoded.
Why does my GIF flicker after removing the background?
Most flicker comes from frame disposal. GIF frames often store only the rectangle that changed, and the next frame depends on what the previous one left behind. A correct decoder composites each frame using its declared disposal method before keying. If a tool ignores disposal, unchanged areas disappear or smear.
Should I remove the background from every frame or just one?
A colour key is cheap, so run it on every frame with the same settings. An AI matte is different: one AI pass produces one silhouette. Reusing that matte across frames only works when the camera is locked off and the subject stays inside the same outline.
What size should a transparent GIF be for Discord?
Discord custom emoji are capped at 128×128 pixels and 256 KB. Twitch emotes come in 112×112, 56×56 and 28×28 versions under 1 MB each. Export at 160 px for Discord if you want a little headroom, then check the reported file size before uploading.
Does removing a GIF background reduce quality?
It can. GIF already limits you to 256 colours per frame, and making pixels transparent removes palette entries you might have used for the subject. A shared palette across frames keeps colours stable; per-frame palettes tend to shimmer on flat areas.
Try it on your own file
The bench is free, runs locally, and needs no account. Load a GIF and see the cut in about three seconds.