[FFmpeg-user] wrong colors in animated GIF

Javier Infante Porro jabi at irontec.com
Thu Sep 26 16:28:02 EEST 2019

Hi Michael,

----- Mensaje original -----
> De: "Michael Koch" <astroelectronic at t-online.de>
> Para: "FFmpeg user questions" <ffmpeg-user at ffmpeg.org>
> Enviados: Jueves, 26 de Septiembre 2019 14:50:50
> Asunto: [FFmpeg-user] wrong colors in animated GIF
> Hi,
> I'm using this animated GIF as input http://gosper.org/sidereal.gif
> and process it with the most simple FFmpeg command line:
> ffmpeg -i sidereal.gif -y out.gif
> Why are the colors wrong in the output?

I suspect it is something about the palette generated.
I have been using palettegen and paletteuse filters lately, and they have worked out fine for me.

This command is working as you might expect:

ffmpeg -y -i sidereal.gif -filter_complex "split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse"  sidereal2.gif

In fact, limiting the number of colors to 128, makes the file smaller:
ffmpeg -i sidereal.gif -filter_complex "split[s0][s1];[s0]palettegen=max_colors=24[p];[s1][p]paletteuse"  sidereal2.1.gif

Hope it helps!

Javier Infante Porro 

More information about the ffmpeg-user mailing list