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

Steven Kan steven at kan.org
Wed May 29 07:07:14 EEST 2024


> On May 19, 2024, at 10:26 AM, Michael Koch <astroelectronic at t-online.de> wrote:
> 
> 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

Thanks! APNG works very well in this case:

https://www.kan.org/pictures/WeightLogLapse.apng

Thanks!


More information about the ffmpeg-user mailing list