Rotate Gif with bug

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Posts: 1
Joined: 2019-04-17T10:06:32-07:00
Authentication code: 1152

Rotate Gif with bug

Post by tiagoferezin »

I am running the command in linux
convert -background none -rotate 60 -limit memory 0 input.gif output.gif
and the return of the gif I have is the one below:


This is my output.gif, and below my input.gif


What happens and how do I fix this problem?
User avatar
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Rotate Gif with bug

Post by fmw42 »

GIF optimization removes parts of the frames to optimize. So you need to coalesce your frames to fill them out to the same size. Then at the end re-optimize. Also in ImageMagick 6 and 7, you need to put the input image first. This works for me on IM Q16 Mac OSX.

Code: Select all

convert bunny.gif -coalesce -background none -rotate 60 -layers optimize newbunny.gif
Please always provide your IM version and platform when asking questions.
Post Reply