[FFmpeg-user] PNG-->GIF produces weird color aliasing?

Michael Koch astroelectronic at t-online.de
Sun May 19 20:26:35 EEST 2024


Am 19.05.2024 um 19:02 schrieb Steven Kan:
> I have a series of 476 PNGs, exported from Excel in a loop through a series of values to control the plotted range:
>
> https://www.kan.org/download/1.png
> https://www.kan.org/download/2.png
> https://www.kan.org/download/3.png
> https://www.kan.org/download/4.png
> https://www.kan.org/download/5.png
> etc.
>
> If I convert them to MP4:
>
> ffmpeg -i %d.png -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2,scale=1920:-1" -c:v libx264 -y WeightLogLapse.mp4
>
> the resulting video looks as I would expect:
>
> https://www.kan.org/download/WeightLogLapse.mp4
>
> But if I convert to GIF:
>
> ffmpeg -i %d.png -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2,scale=1920:-1" -y WeightLogLapse.gif
>
> I get this weird color aliasing:

It's a known problem. A workaround is described in chapter 2.70 in my book:
http://www.astro-electronic.de/FFmpeg_Book.pdf

Michael



More information about the ffmpeg-user mailing list