ffmpeg won this argument years ago
Any honest page about making GIFs on Linux has to open here. The canonical answer is two commands, and it is genuinely excellent:
- Build a palette: ffmpeg -i in.mp4 -vf "fps=15,scale=800:-1:flags=lanczos,palettegen" palette.png
- Use it: ffmpeg -i in.mp4 -i palette.png -filter_complex "fps=15,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" out.gif
The two-pass structure exists for a real reason. GIF allows 256 colors per frame, so something has to decide which 256. Letting the encoder guess frame by frame produces the muddy, shifting result everyone recognizes; palettegen instead surveys the whole clip first and picks one table that serves all of it. Then gifsicle cleans up afterward, with --lossy if you want to trade a little grain for a lot of bytes.
If those two lines are already in your shell history, close this tab with our blessing. You have the better tool for the job you do.
The part of the two-step that costs you a re-render
The pipeline's weakness is not quality, it is the feedback loop. You choose fps, scale, and palette size blind, wait for the encode, run ls -lh, discover the result is 8 MB against a 5 MB ceiling, and change a number. Then you do it again. Every iteration costs a full render, and if you are chasing a hard limit for a bug tracker or a chat client, four rounds is normal.
What the GIF closes that loop instead of shortening it. A projected output size sits next to the controls and moves while you drag them, so you find the settings that fit before anything encodes. A Play edit button runs the whole assembly, including cuts and captions, through the same pipeline that will produce the file, so the preview is the export rather than an approximation of it.
The trim is the other piece. Both ends snap to genuine frames and the arrow keys step them, all of it against a running preview. Finding the exact frame where an animation completes is a visual problem, and doing it by editing timestamps in a shell command is the slow way to solve it.
No package, no distro question
Nothing installs, which quietly settles a pile of Linux-specific questions before they get asked. There is no .deb and no .rpm, so no repository to add. No Flatpak, no Snap, no AppImage to chmod. Nothing pulls in a runtime, nothing conflicts with your package manager, and nothing needs updating when you next dist-upgrade.
It is a web page, so the distro is irrelevant. Debian, Arch, Fedora, Mint, NixOS, an old Ubuntu LTS on a machine you're afraid to touch: all identical. Wayland or X11 makes no difference either, since the browser handles the display and the tool never talks to it. Firefox and Chromium both run it, which covers whatever shipped as your default.
Record a Tab does work here, unlike on tablets. The browser's native share dialog does the choosing, whether that is one tab, one window, or the whole display, and whatever comes back arrives in the editor as an ordinary clip. It runs at wall-clock speed and cuts itself off after five minutes, but for catching a CSS animation or a web app misbehaving it saves you a trip to a separate capture tool.
How the palette actually gets built here
Since you're the audience that will ask: quantization runs median cut first, then refines the result with k-means (Lloyd's algorithm) over the sampled pixels. Medium quality runs two refinement passes; High runs four and samples frames more densely. Measured against median cut on its own, that lands roughly 9 to 15 percent lower quantization error on gradient-heavy footage at the same file size. Low skips the refinement entirely when you want speed.
A lossless pass runs on every GIF export as well: duplicate frames collapse into one, and what survives keeps only the rectangle that actually changed. Same pixels out, fewer bytes, and no setting to hunt for. Beyond that there is an Extra Compression setting in the same tradition as gifsicle's lossy LZW, at Light, Medium, or Strong, where Medium typically takes 30 to 50 percent off in exchange for mild grain.
None of this beats a tuned ffmpeg command in a benchmark. It is meant to get you a good file without a benchmark.
Keep ffmpeg in your PATH
There are jobs a browser tab has no business touching, and they are the jobs Linux users have most often:
- Batches. Forty clips through the same settings is a for loop, not forty visits to a web page. ffmpeg wins outright and it isn't close.
- Anything headless. CI pipelines, cron jobs, a box with no display: there is no browser to run this in.
- Exotic sources. Odd codecs, weird containers, or streams that need remuxing first are ffmpeg's home turf. This tool takes what your browser can decode.
- Reproducibility. A command in a script produces the same output next year. A person dragging sliders does not.
So this is not a replacement, it is a different shaped tool. One clip, a size target you have to hit, and a loop point you need to see: open the tab. Everything else: you already know the command. For the weight-tuning specifics either way, the small-file page and the compression walkthrough get into the numbers.