Page 1 of 1

Error with animators with over 10 frames

Posted: 2008-07-14T17:48:18-07:00
by flintstone
With less than 10 frames, animated gifs come out fine (with convert.exe)
after 10 frames, it shows frame 1, then 10, then continues as normal. at the end, it pauses before looping.

Re: Error with animators with over 10 frames

Posted: 2008-07-14T18:20:25-07:00
by anthony
Can you give use a more detailed example?

Re: Error with animators with over 10 frames

Posted: 2008-07-14T19:01:57-07:00
by flintstone
Image
This animation has 11 frames, titled frame[0-10].gif. Each one has one more letter than the last.
It was made with the command convert.exe -delay 30 -loop 0 frames/frame*.gif result.gif, which worked for animations with 9 or less frames.

Re: Error with animators with over 10 frames

Posted: 2008-07-14T20:41:38-07:00
by anthony
flintstone wrote:

Code: Select all

convert.exe -delay 30 -loop 0 frames/frame*.gif result.gif
Well that your problem!!!! You assume IM recieved your images in numerical order! It didn.t The order is NOT what IM recieved and thus not IM's fault!

The rest of the animation does not appear as it is using a transparent background without using a -dispose background or -dispose previous to clear the old frames completely. So the frames just overwrite what the second frame has already drawn, making no more changes. See IM examples, Animation Basics for details of disposal methods!

try this...

Code: Select all

echo frames/frame*.gif
You will find you got frame1.gif then frame10.gif then frame2.gif
WHY? because it is sorts alphabetically, NOT numerically

Use this instead.

Code: Select all

   convert.exe -delay 30 -loop 0 frames/frame?.gif frames/frame??.gif result.gif
that will list single digit frames first, then double digit frames!!!
OR if you have a more advanced shell (like bash) use...

Code: Select all

   convert.exe -delay 30 -loop 0 frames/frame{?,??,???}.gif  result.gif
better still save all your frames using the same number of digits, so they are in order alphabetically
01 02 03 ... 09 10 11
See IM Examples, Writing a Multi-Image Sequence for other alternatives for reading files numerically.


There are also tools and utilities that you can use to do this, for you.

I have one called mv_renum that renames files so it expands numbers to enough digits to match the largest number given.
I have another script (same one actually just with a different name) called mv_reseq that will resequence the numbers to start at the number given (1 by default) and increment the files by a second number given (1) I use this to expand filenames so I can insert extra files inbetween, then contract the numbers back down to incrementing numbers again. Very useful for sorting image sequences.

Re: Error with animators with over 10 frames

Posted: 2008-07-15T08:20:28-07:00
by flintstone
Thanks!