使用 imagemagick 更改动画图像背景

change animated image background using imagemagick

我正在尝试使用 imagemagick 填充 gif 的背景, this is the input file 我能够裁剪背景 still not perfect but it's an acceptable result 现在,当我尝试填充背景时: the output is static despite being a gif 这是我试过的命令:

convert "" -resize 400x400  -gravity center -background "pink" -extent 400x400 "out.gif"

我做错了什么?

我不知道您要做什么,但这应该会告诉您如何使用 floodfill:

替换背景
magick crybaby.gif -coalesce -fuzz 10% -fill yellow -floodfill 0x0 "rgb(251,102,90)" result.gif