Quantcast
Channel: How do I resize an animated GIF and keep transparency? - Super User
Viewing all articles
Browse latest Browse all 2

How do I resize an animated GIF and keep transparency?

$
0
0

I tried to resize an animated GIF with transparency, but it turned the background a solid white. How do I keep the transparency?

I read https://superuser.com/a/556031/130929 and tried

>set FILTERS=scale=320:-1:flags=lanczos>ffmpeg -hide_banner -i logo.gif -vf "%FILTERS%,palettegen=stats_mode=diff" -y palette.png>ffmpeg -hide_banner -i logo.gif -i palette.png -lavfi "%FILTERS% [x]; [x][1:v] paletteuse" logo-320.gif

I also tried -gifflags +transdiff but it didn't help as the blog post in the answer says it's the default anyways. I also tried without stats_mode=diff.

I also tried with a palette for each frame, but that only made the file bigger and didn't keep transparency.

>ffmpeg -hide_banner -i logo.gif -filter_complex "[0:v] scale=320:-1:flags=lanczos,split [a][b]; [a] palettegen=stats_mode=single [p]; [b][p] paletteuse=new=1" logo-320.gif

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images