ImageMagick rotate animated gif glitches

2019-08-29 09:46发布

I'm using ImageMagick to rotate animated gifs. Simply:

convert image.gif -rotate 32 -alpha set -background none output.gif

Output: https://s3-eu-west-1.amazonaws.com/uploads-eu.hipchat.com/108112/892631/ATp8mXXrDdSkCNu/sowa-test2.gif

Does anyone have a clue why output image is distorted this way and how to avoid this?

1条回答
冷血范
2楼-- · 2019-08-29 10:25

Without seeing the original image, I would suggest extracting each image, apply rotation, and then re-build the animated gif.

Example using the following gif:

anim_none.gif

convert anim_none.gif -scene 1 +adjoin tmp_%02d.gif
mogrify -rotate 32 -alpha set -background none tmp_*.gif
convert tmp_*.gif -loop 0 final.gif

Rotated animated gif

And note: quality is expected to degrade with rotation operations.

查看更多
登录 后发表回答