Skip to main content
PixelTools
All articles
Guides5 min readby the PixelTools team

Video to GIF Looks Grainy? Here's the Fix

A GIF made from video looks grainy or dotted because it only holds 256 colors. Here is what causes the grain and the settings that actually fix it.

Why a GIF made from video looks grainy

The grain is the GIF format running out of colors. A GIF frame can hold at most 256 colors, while the video it came from used millions. To fake the missing shades, the encoder mixes dots of nearby colors (dithering), and on smooth areas like sky, skin or a wall that mix shows up as speckle or a checkerboard. Banding, where a gradient turns into visible stripes, is the same problem seen from the other side. So some grain is normal for GIF. What is not normal is a flat blue sky that looks like a woven mat. That is a sign the converter picked a bad set of 256 colors, and that is fixable.

What a bad palette costs: our test numbers

We ran the same filters PixelTools uses (12 fps, 480 px wide, palette built from the clip, ordered dithering) on a synthetic 4-second smooth-gradient clip, and compared it with ffmpeg's default one-pass GIF export at the same size. Measured against the scaled source, the palette-first GIF scored 27.0 dB PSNR. The default export scored 19.2 dB. Zoomed in on a flat blue area, the default export showed a clear checkerboard of lighter and darker dots, while the palette-first GIF stayed clean. This was a synthetic clip, not real footage, so treat the dB gap as a demonstration of the mechanism rather than a promise for your video.

Fix 1: convert from the original video, with a clip-specific palette

Go back to the source video and convert again with a tool that builds the palette from your actual clip before encoding. PixelTools' [Video to GIF](/video-to-gif) does this in two passes: it first scans the clip for the best 256 colors, then encodes using only those. Do not start from a GIF you already have. Detail lost when colors were cut cannot be recovered, and each re-export adds a fresh layer of dithering on top of the old one. If you only have the GIF and the video is gone, accept that the grain is baked in, or try a different source for the clip.

Fix 2: do not resize a finished GIF with a generic tool

Shrinking an existing GIF is where grain often gets worse. We took the 480 px GIF above and scaled it to 320 px with ffmpeg's default GIF writer. The result scored 19.3 dB and came out at 1,156,531 bytes. Converting the original video straight to 320 px with a clip-specific palette scored 26.8 dB at 433,579 bytes. That is about 2.7 times smaller and visibly cleaner. The lesson: choose your final width when you convert from the video. The Video to GIF tool offers 320, 480 and 640 px for exactly this reason.

Fix 3: pick settings that suit the clip

Output size is the setting you control most, and a shorter or smaller clip is also easier on the palette. On our 4-second test clip at the tool's ordered dithering, 12 fps produced 433,579 bytes at 320 px, 933,589 at 480 px and 1,670,760 at 640 px. Dropping to 8 fps at 480 px gave 653,577 bytes. A shorter trim also helps, because a palette shared by fewer frames has fewer colors to cover. If a clip has long smooth gradients and you need it clean, consider [GIF to MP4](/blog/gif-to-mp4) instead, since MP4 has no 256-color limit.

What we did not test

We measured one synthetic gradient clip with ffmpeg 6.1 on a desktop, using the same filter chain PixelTools runs, not the in-browser WebAssembly build itself. We did not test screen recordings, cartoon footage or noisy phone video, where results will differ, and PSNR does not capture every visible artifact. The dotted look of ordered dithering is also a deliberate trade-off: in our test, turning dithering off saved about 18 percent in bytes (763,233 versus 933,589) but PSNR barely moved, so the pattern mostly affects how the gradient looks, not how accurate it is.

Frequently asked questions

Try it on PixelTools — free, no upload needed