jpg to gif problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
phobos
Posts: 13
Joined: 2013-04-07T03:07:18-07:00
Authentication code: 6789

jpg to gif problem

Post by phobos »

hello!
i have 50 jpg pictures frames from video
5 seconds to 10 frames each
pictures with names
/mydir/i1.jpg
/mydir/i2.jpg
/mydir/i3.jpg
..
/mydir/i50.jpg
i want unite all frames in one animated gif picture
i try use command

Code: Select all

convert   -delay 20   -loop 0   i*.jpg   animatespheres.gif
but the images are combined in the wrong order
something like this
i1
i10
i11
..
i19
i2
i20
i21
..
i49
i5
i50
result Image
i use php and run commands with exec().
how to sort by name picture names before merging into the animated gif? :(
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: jpg to gif problem

Post by fmw42 »

Name your images i01 ... i50. That is they need the leading zeros to sort properly.
phobos
Posts: 13
Joined: 2013-04-07T03:07:18-07:00
Authentication code: 6789

Re: jpg to gif problem

Post by phobos »

fmw42 wrote:Name your images i01 ... i50. That is they need the leading zeros to sort properly.
yes, with 0 it work nice!
Image
thank you again fmw42! :-P
Post Reply