Video · 59 tools · nothing uploads

Video to GIF

Convert 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. Nothing is uploaded.

Input

Options

Video to GIF samples frames from a clip at 10 frames per second, scales them to 480 pixels wide and stops after 150 frames. It then maps every pixel onto one shared 256 colour palette and does not dither, so gradients band. Frame decoding needs WebCodecs, which Node lacks, so this one runs on the page only.

Questions

Why does my GIF look posterised or banded?

Because GIF has no true colour. Every frame is mapped onto one shared palette of up to 256 colours, built by median cut across every frame the tool decodes, and each pixel is snapped to its nearest palette entry. There is no dithering, so smooth gradients turn into visible bands. Raising colors up to its 256 maximum helps; it cannot remove the limit.

Why is my GIF so large?

Because GIF stores whole frames with no interframe video compression. The defaults exist to hold that down: 10 frames per second, 480 pixels wide and at most 150 frames. Lower fps, a smaller width or a smaller colors value all shrink the result. Clearing width keeps the source width, which gets large fast.

How long a clip can I convert?

Whatever fits inside maxFrames, 150 by default, at the fps you choose. At the default 10 frames per second that is about 15 seconds of video. Frames past the cap are never sampled. Trim the video first if you want a later section, since sampling always starts at the beginning.

Does it need a browser?

Yes. Frames are decoded through WebCodecs, which Node has no equivalent of, so the CLI and MCP surfaces refuse it with "video-to-gif needs a browser (OffscreenCanvas). Use it at /video/video-to-gif instead." WebCodecs has no GIF encoder at all, so the GIF89a bytes are written by this tool itself after the frames come back.

What do the settings mean exactly?

fps is how often a frame is sampled from the source and also sets each frame delay, computed as 1000 divided by fps in milliseconds. width downscales the picture, 480 by default. maxFrames stops the sampling. colors is the palette size and must be a whole number between 2 and 256. The result tells you the frame count, the pixel size and the palette size it used.

Does the GIF loop?

Yes, always. The encoder writes the looping extension into every GIF it makes, and there is no option to turn that off. If you need a single play, that is a property of the player, not something this file can express differently.

Compare

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

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→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 dropn→nOptimize GIFShrink 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.Runs on each file you drop