Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Video-to-GIF conversions can look dirty because GIF has to represent the clip’s colors with a limited palette. FFmpeg’s two-pass workflow first builds a palette for the video, then uses that palette when encoding the GIF. This gives the conversion a palette drawn from the clip instead of relying on a single-pass mapping.

Why a video can look worse as a GIF

A video can contain more colors and smoother gradients than a GIF palette can represent. When the conversion maps the source into that smaller set of colors, subtle transitions may turn into visible bands, and some colors may shift or disappear. Dithering can make those transitions appear smoother by spreading color error across neighboring pixels, but it may introduce visible patterns or moving noise—and noisy texture can increase file size.

FFmpeg’s palettegen creates a palette from the video, and paletteuse applies it during GIF conversion. FFmpeg describes palettegen as generating “one palette for a whole video stream.” FFmpeg Filters Documentation: palettegen

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use FFmpeg’s two-pass palette workflow

Run these commands from a shell with FFmpeg installed. Replace the filenames with the source video and the output names you want:

#1 Best Overall
Alienware Aurora Gaming Desktop, RTX 5070, Intel Core Ultra 7 265F
  • Legend perfected: Modern design with a matte basalt black finish in an optimized chassis with customizable AlienFX lighting zones, including the striking stadium lighting.
  • Game changing graphics: Step into the future of gaming and creation with the NVIDIA GeForce RTX 5070 graphics, powered by NVIDIA Blackwell architecture.
  • Marathon gaming unlocked: This high-performance technology ensures clean energy is consistently available, unleashing the top-level power of Intel Core Ultra 7 265F processor as you game, livestream, and multi-task for hours on end.
  • Total command: Alienware Command Center software allows you to create and edit AlienFX lighting across the ecosystem, choose and monitor your performance mode across distinct power states, and create custom gaming profiles for your whole library.
  • Dell Services: 1 Year Onsite Service provides support when and where you need it. Dell will come to your home, office, or location of choice, if an issue covered by Limited Hardware Warranty cannot be resolved remotely.
ffmpeg -i input.mp4 -vf palettegen palette.png
ffmpeg -i input.mp4 -i palette.png -lavfi paletteuse output.gif
  1. Generate the palette: the first command reads input.mp4 and writes a representative palette image, palette.png.
  2. Apply the palette: the second command reads both the original video and palette image, then maps the video’s colors through that palette to create output.gif.

This basic example does not trim, scale, change the frame rate, or otherwise prepare the clip. Make those choices separately according to the GIF you need; the palette workflow addresses color mapping, not clip length or dimensions. FFmpeg documents this two-command pattern in its paletteuse examples.

Diagnose the artifact before changing settings

“Dirty” can mean different things, and each symptom points to a different trade-off. Look at the result at its intended display size and watch the whole sequence, not just a single frame.

Rank #2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • Model: Dell OptiPlex 7050 Small Form Factor (SFF)
  • Processor: Intel Core i7-7700 3.60 GHz
  • Memory: 32GB DDR4 Ram
  • Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
  • Operating System: Windows 11 Pro (64-bit)
  • Important colors are missing or shifted: consider how the palette represents the clip’s colors. Dithering changes how color error is rendered; it does not add colors to the palette.
  • Gradients show bands: dithering may make transitions look smoother, at the cost of visible texture.
  • You see crosshatches or speckling: try another dithering mode or disable dithering, then check whether banding becomes more noticeable.
  • Texture flickers or moves across frames: assess temporal stability; a setting that looks acceptable in a still frame may be distracting in motion.
  • The GIF is larger than expected: compare file weight as well as appearance. Noisy dithering can increase output size, but the change depends on the clip and settings.

Choose palette and dithering settings by symptom

Try a different dithering mode

FFmpeg’s documented default is sierra2_4a. Other available modes include bayer, floyd_steinberg, sierra2, sierra3, burkes, atkinson, and none. No mode is best for every clip: compare color transitions, visible texture, flicker, and file size on your own sequence. FFmpeg Filters Documentation: paletteuse options

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

bayer produces a deterministic ordered pattern. Its bayer_scale option controls how visible the crosshatch is, with a trade-off against banding. Setting dithering to none avoids dithering texture but can make color steps more obvious.

Rank #3
ZYNEEX Prebuilt Gaming Desktop PC, AMD Ryzen 5 5500, GeForce RTX 3050 6GB,16GB DDR4 3200MHz RAM, 1TB NVMe SSD, ARGB Air Cooling, Wi-Fi,Tower Computer for Gaming, Streaming, Editing
  • 【POWERFUL PERFORMANCE】 – AMD Ryzen 5 5500 6-Core 12-Thread Desktop Processor (up to 4.2GHz). Effortlessly handle 3A games, 4K video editing, and multitasking.
  • 【SMOOTH GAMING】 – Equipped with GeForce RTX 3050 6GB GDDR6 Graphics Card. Experience high-frame-rate 1080P gaming with ray tracing.
  • 【FAST & AMPLE STORAGE】 – 16GB DDR4 3200MHz RAM + 1TB NVMe SSD. Enjoy rapid game loads, quick file transfers, and ample space for your entire library.
  • 【KEEP COOL】 – Advanced ARGB air cooling system with multiple fans. Maintains stable performance and low noise even during marathon gaming sessions.
  • 【READY TO USE】 – Features built-in Wi-Fi, multiple USB ports, HDMI and DisplayPort (DP) outputs for flexible monitor connectivity. A complete prebuilt gaming computer, plug and play right out of the box.

Adjust the palette’s color budget only when color representation is the issue

palettegen provides a max_colors option to limit how many colors are selected. The palette image’s 256-entry capacity does not mean all 256 entries contain useful colors: unused entries are black. By default, one palette entry is reserved for transparency, which is useful for GIF optimization; FFmpeg says that reservation can be disabled when generating a palette for a standalone image. FFmpeg Filters Documentation: palettegen options

Match histogram behavior to the scene

The histogram setting affects how palette colors are chosen across frames:

Rank #4
Thermaltake LCGS View i570-170 Gaming Desktop (Intel Core™ i9-14900KF, ToughRam 32GB DDR5 6000MT/s RGB Memory, NVIDIA® GeForce RTX™ 5070, 1TB NVMe M.2, WiFi, Windows 11) V17B-B76B-570-LCS
  • Intel Core i9-14900KF CPU, B760 chipset motherboard, 32GB DDR5 6000MT/s RGB Memory, 1TB NVMe M.2, WiFi, Windows 11
  • NVIDIA GeForce RTX 5070, Display Port/HDMI
  • Closed Loop Liquid Cooling with 240mm Radiator
  • 2x USB 3.0, 1x Headphone, 1x Mic
  • PSU Power cover with Filtered Ventilated Vertical Side mount Radiator support
  • stats_mode=full computes histograms over full frames.
  • stats_mode=diff considers only the area that differs from the previous frame. This can give moving content more influence when it appears against a mostly static background.
  • stats_mode=single computes a new histogram for each frame. Separately, paletteuse=new takes a new palette for each output frame.

These choices change palette behavior. Check whether colors or textures flicker and compare file size on the actual clip before settling on one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Consider changed-region processing for mostly static scenes

For a scene where only a small area moves, diff_mode=rectangle reprocesses the changing rectangle. FFmpeg notes that this can limit error-diffusion processing to the moving scene and may reduce moving noise and improve GIF compression when little changes. It is a targeted option for that kind of sequence, not a general fix for incorrect colors. FFmpeg Filters Documentation: paletteuse options

Best Value
HP Workstation PC Desktop Computer | Editing and Design | NVIDIA Quadro K1200 4GB GPU | Intel Core i5 | 32GB DDR4 RAM, 1TB SSD + 4TB HDD | Wi-Fi 5G + Bluetooth | Windows 11 Pro (Renewed)
  • Content Creation Workstation PC: Powered by the Intel Hexa-Core i5 (8th Gen) processor with 32GB DDR4 RAM and NVIDIA's Quadro K1200 4GB Graphics Card, this Workstation PC Computer is built for creative environments
  • NVIDIA's Quadro K1200 4GB Graphics Card: Graphic support built to be an efficient workstation for creative applications like photo and video editing, 3D Design, AutoCAD, and much more
  • Software Compatibility: Workstation PC for use with independent software vendors (ISV) and certified for use with modeling, rendering, and engineering software from Adobe, AutoCAD, 3DS Max, and many more
  • Massive Storage Solutions: An ultra-fast 1TB Solid State Drive (SSD) setup as the primary boot device; Boot and load programs with little to no lag; An additional 4TB Hard Disk Drive (HDD) is installed for additional storage; Never run out of storage
  • Connectivity for Creative Projects: USB 3.0 (x5) | USB 2.0 (x4) | USB Type-C (x1) | DisplayPort (x2) | Serial Port (x1) | VGA Port (x1) | Audio Combo Jack (x1) | Audio In (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Compare settings without guessing

Make one change at a time and keep the source clip and dimensions constant. Judge each result using the same four checks:

  • Color fidelity: Do important colors, shadows, and gradients survive?
  • Texture: Is banding less distracting, or has it been replaced by an ordered pattern or noisy speckling?
  • Temporal stability: Does texture or color visibly flicker as the scene changes?
  • File size and processing: Is the visual improvement worth any increase in file weight or processing cost?

FFmpeg’s palettegen also exports lavfi.color_quant_ratio, defined as the number of input colors divided by the number of output colors. It is available as frame metadata and at info log level. Use it as a diagnostic of how much quantization is occurring, not as a standalone measure of GIF quality. FFmpeg Filters Documentation: palettegen metadata

What the two-pass fix can—and cannot—do

The palette workflow gives FFmpeg a clip-specific palette to use for GIF mapping. It cannot make GIF preserve every source color, and it does not guarantee that one dithering mode will eliminate banding without adding texture or file weight. The practical choice is a balance: retain the colors that matter, keep artifacts unobtrusive in motion, and avoid a file size you do not need. A 2015 FFmpeg development-list discussion by contributor Clément Bœsch describes the two-command approach and notes that overly noisy dithering can make output files larger; current option behavior is documented in FFmpeg’s filter documentation. FFmpeg development mailing-list message, January 25, 2015

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.