Video · 59 tools · nothing uploads

Optimize GIF

Shrink an animated GIF by lowering its color count, dropping frames or resizing it, through the same GIF89a encoder and decoder video-to-gif uses. Reports the size before and after. Runs in Node, the CLI and MCP as well as the browser.

Input

Options

Optimize GIF shrinks an animated file by cutting its palette size, dropping every Nth frame, or resizing it. The same GIF89a reader and writer behind Video to GIF do the work here. The result names the byte count before and after, and dropping every single frame is refused. This works in Node, the CLI, or MCP, no browser required.

Questions

How much smaller will my GIF get?

That depends on the settings and the source. The report names the exact byte count before and after, so you can judge each run rather than expect a fixed percentage.

What does dropEveryNth do?

It removes every Nth frame to shrink the file further, 0 by default, meaning every frame is kept. Setting it high enough to remove every frame is refused.

Does resizing keep the aspect ratio?

Yes. Setting width scales the height to match the source proportions automatically; leaving it blank keeps the original width and height.

What colour count should I use?

Between 2 and 256, 128 by default. A smaller palette shrinks the file further at the cost of more visible banding in gradients.

Does this run outside the browser?

Yes. It uses the same plain byte GIF encoder and decoder as video-to-gif, with no canvas involved, so it runs in Node, on the command line and through MCP as well as the browser.

Compare

ToolRuns on the CLILive as you type
Optimize GIFYesNo
Video thumbnailNoNo
Extract video framesNoNo
Video to GIFNoNo
GIF to videoNoNo

Related Video tools

n→nVideo thumbnailGrab a single frame from a video as a PNG or JPEG, in the browser only, like PDF to PNG, because decoding a frame needs WebCodecs, which Node has no equivalent of.Runs on each file you dropn→nExtract video framesPull out one frame every N seconds as a sequence of PNGs, in the browser only, like PDF to PNG, because decoding frames needs WebCodecs, which Node has no equivalent of.Runs on each file you dropn→nVideo to GIFConvert a video clip to an animated GIF. In the browser only, like video-extract-frames, because decoding frames needs WebCodecs, which Node has no equivalent of. WebCodecs has no GIF codec at all, so this decodes frames with mediabunny/WebCodecs and then builds the GIF89a bytes itself: one shared 256-colour palette (median-cut, sampled across every frame this tool decodes, not per-frame) so colours stay consistent frame to frame, with each pixel mapped to its nearest palette entry. No dithering.Runs on each file you dropn→nGIF to videoConvert an animated GIF into a video, in the browser only, like video-convert, because encoding needs WebCodecs, which Node has no equivalent of. WebCodecs has no GIF codec at all, so this parses the GIF89a bytes itself, including disposal method and transparency compositing, so a GIF built from partial-frame deltas decodes to the same full frames a browser would show, not only its raw per-frame rectangles. It then feeds the composited frames to mediabunny/WebCodecs to encode. Always outputs MP4, following every other Node-native remux tool in this codebase; each frame's own GIF delay becomes its video frame duration. MP4 has no alpha channel, so any transparent GIF pixel, composited onto a canvas that starts fully transparent black, becomes opaque black in the video, not the checkerboard a GIF viewer shows; verified by executing this tool against a transparent fixture and reading the pixel back out.Runs on each file you drop