Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › dithering

Why Your Video-to-GIF Conversions Look Dirty—and How to Fix Them with FFmpeg

By Freedom251 Team · · 3 min read

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Video-to-GIF conversions often look dirty because GIF can represent only a limited set of colors. FFmpeg’s two-pass palette workflow gives it a representative color palette for the clip, then uses that palette to create the GIF. From there, you can tune dithering and palette behavior to address banding, noisy texture, or unstable colors without assuming one setting works best for every video.

Why a GIF can look worse than its source video

A video can contain more colors and smoother transitions than a GIF can preserve. During conversion, colors have to be mapped to a limited palette, so gradients may become bands and subtle shades may shift or disappear. Dithering can disguise some of those steps by distributing color error across nearby pixels, but it can also add visible patterns or moving texture.

As an Amazon Associate I earn from qualifying purchases.

FFmpeg’s palettegen filter generates a palette for a video stream; paletteuse applies that palette when mapping the video to GIF colors. 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.

Make a two-pass GIF with FFmpeg

In a terminal, run these commands from the folder containing the input video, replacing the filenames as needed:

#1 Best Overall
Alienware Aurora Gaming Desktop, RTX 5070, Intel Core Ultra 7 265F | 1TB SSD, 32GB DDR5, Wi‑Fi 7, Bluetooth, Killer 2.5Gb Ethernet, Windows 11 Home, Wired Keyboard, ACT1250
  • 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

The first command creates a representative palette image. The second reads both the original video and that palette, then maps the video’s colors into it. This basic example does not trim, resize, or change the frame rate; those are separate choices to make for the GIF you want.

Diagnose the defect before changing settings

Look closely at the output and identify the main problem. Missing or shifted colors point to palette representation; visible steps in a gradient suggest banding; a crosshatch or grainy texture points to dithering; and texture that changes from frame to frame may look like motion noise. File size matters too: a noisier image may take more data to encode. Change one relevant setting at a time, then compare the same clip and dimensions for color fidelity, texture, temporal stability, and file size.

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)

Choose a dithering mode for the clip

FFmpeg’s documented default is sierra2_4a. Other available modes include bayer, floyd_steinberg, sierra2, sierra3, burkes, atkinson, and none. There is no universally best choice: a mode that softens gradient steps may add texture, and disabling dithering can reduce that texture while making color steps more obvious. FFmpeg Filters Documentation: paletteuse

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

Bayer dithering is deterministic. Its bayer_scale option controls how visible the crosshatch pattern is, with a tradeoff against banding. Test the result on the actual clip rather than choosing by name alone. Noisy dithering can also increase output size; that tradeoff was noted in a 2015 FFmpeg development discussion, rather than established as a fixed result for every video. FFmpeg development mailing-list message, 25 January 2015

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 palette generation when color representation is the problem

The palettegen filter’s max_colors option controls the maximum number of selected colors. Its palette image still has capacity for 256 entries; unused entries are black, so the image’s capacity should not be mistaken for the number of useful colors selected. By default, one entry is reserved for transparency, which is useful for GIF optimization. The documentation says this reservation can be disabled when generating a palette for a standalone image. FFmpeg Filters Documentation: palettegen

Choose histogram behavior for the motion in the clip

Palette generation can emphasize different parts of a sequence. The documented stats_mode options are:

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
  • full: computes histograms over full frames.
  • diff: considers only the area differing from the previous frame, which can give moving content more weight against a static background.
  • single: computes a new histogram for each frame.

Separately, paletteuse=new takes a new palette for each output frame. These choices affect palette behavior, so check both visual stability and file size on the actual sequence rather than presuming per-frame palettes will improve it. FFmpeg Filters Documentation: palettegen FFmpeg Filters Documentation: paletteuse

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Reduce moving noise in mostly static scenes

For a clip with a mostly fixed background and a smaller moving subject, diff_mode=rectangle makes paletteuse reprocess the changing rectangle. FFmpeg notes this can limit error-diffusion processing to the moving scene and may reduce moving noise while improving GIF compression when little changes. It is a targeted option for that kind of content, not a general fix for inaccurate colors. FFmpeg Filters Documentation: paletteuse

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)

Use quantization metadata as a diagnostic

palettegen exports lavfi.color_quant_ratio as frame metadata. The ratio is nb_color_in / nb_color_out, and it is also visible at info log level. It indicates the degree of quantization; it is not a standalone score of how good the GIF looks. Judge the result by viewing the output alongside the source, including its colors, gradients, frame-to-frame texture, and file weight. FFmpeg Filters Documentation: palettegen

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.

ditheringFFmpegGIFpalette generationvideo conversion

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.