Convert animated gif - delay 0 problem
Convert animated gif - delay 0 problem
Hey Folks!
I discovered ImageMagick threw this article: http://jacobsalmela.com/make-animated-g ... ght-click/
and searching a way to convert a bunch of single frames into some gifs for my porfolio.
so, i did everything that is written in the article and it works pretty fine so far.
just some details are wrong as you can see
1. the background is weird - it seams that all frames are getting overlapped somehow?
2. the background of the gif is transparent, how can i say that the background should be black? even if the source images are transparent. maybe this even solves problem 1?
by the way, here are the frames:
3. the delay is somehow not 0? or at least it feeals to me that the FPS is wrong?
Thanks for your help!
Kev
I discovered ImageMagick threw this article: http://jacobsalmela.com/make-animated-g ... ght-click/
and searching a way to convert a bunch of single frames into some gifs for my porfolio.
so, i did everything that is written in the article and it works pretty fine so far.
just some details are wrong as you can see
1. the background is weird - it seams that all frames are getting overlapped somehow?
2. the background of the gif is transparent, how can i say that the background should be black? even if the source images are transparent. maybe this even solves problem 1?
by the way, here are the frames:
3. the delay is somehow not 0? or at least it feeals to me that the FPS is wrong?
Thanks for your help!
Kev
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert animated gif - delay 0 problem
Advice is difficult when you don't tell us the command you used, or the version of IM you are using, nor provide the actual PNG input files.
snibgo's IM pages: im.snibgo.com
Re: Convert animated gif - delay 0 problem
sorry, input looks like this in the automator: (its from the article above)
/usr/local/bin/convert -delay 0 -loop 0 "$@" ~/Desktop/animated.gif
version is 6.9.0-3
and here are the pngs:
https://www.dropbox.com/s/3tij2ohp0hhqh ... v.zip?dl=0
thanks!
/usr/local/bin/convert -delay 0 -loop 0 "$@" ~/Desktop/animated.gif
version is 6.9.0-3
and here are the pngs:
https://www.dropbox.com/s/3tij2ohp0hhqh ... v.zip?dl=0
thanks!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert animated gif - delay 0 problem
This command works fine for me, displaying all 80 frames in about 4 seconds:
"-background Black -alpha Remove" makes the background black. If you want the transparency, remove those words. "-layers Optimize" optimize kaes the output gif smaller.
For "-delay", see http://www.imagemagick.org/script/comma ... .php#delay . Drawing each frame takes time.
Code: Select all
convert -delay 0 -loop 0 frame_*.png -background Black -alpha Remove -layers Optimize a.gif
For "-delay", see http://www.imagemagick.org/script/comma ... .php#delay . Drawing each frame takes time.
snibgo's IM pages: im.snibgo.com
Re: Convert animated gif - delay 0 problem
okay, thanks. that solves the first two problems.
looks like this now:
and my animator script looks like this:
/usr/local/bin/convert -delay 0 -loop 0 -background Black -alpha Remove -layers Optimize "$@" ~/Desktop/animated.gif
(had to remove the "frame_*.png" since it didn't worked with it inside the mac automator)
the same sequence exported from photoshop:
(forgot to make it loop-able but thats easy) but you see the difference? its running with 60FPS, can i also raise the FPS in imagemagick? cause i think now it must be 30 or something?
looks like this now:
and my animator script looks like this:
/usr/local/bin/convert -delay 0 -loop 0 -background Black -alpha Remove -layers Optimize "$@" ~/Desktop/animated.gif
(had to remove the "frame_*.png" since it didn't worked with it inside the mac automator)
the same sequence exported from photoshop:
(forgot to make it loop-able but thats easy) but you see the difference? its running with 60FPS, can i also raise the FPS in imagemagick? cause i think now it must be 30 or something?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert animated gif - delay 0 problem
It is puzzling to me why using -delay 0 is slower than using -delay 5. Perhaps it is reading some delay value in your images and using that in stead of 0.
I took the slow animated gif and regenerated it with -delay 2 and it runs a lot faster. You can adjust the delay to whatever value you want. Delays are in tics (1/100 sec). See http://www.imagemagick.org/script/comma ... .php#delay. So 60 frames/sec would be 100tics/60 = 1.7 or about 2
I took the slow animated gif and regenerated it with -delay 2 and it runs a lot faster. You can adjust the delay to whatever value you want. Delays are in tics (1/100 sec). See http://www.imagemagick.org/script/comma ... .php#delay. So 60 frames/sec would be 100tics/60 = 1.7 or about 2
Code: Select all
convert -delay 2 animated.gif -coalesce -layers optimize -loop 0 new_animation.gif
Re: Convert animated gif - delay 0 problem
Bear in mind that for GIFs, "-delay 0" means "-delay .01 second". coders/gif.c seems to enforce that on writing but not on reading, and animate.c interprets 0 delay as 1 tick..
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert animated gif - delay 0 problem
I am not sure that it is working that way. Correct me if I am wrong, but .01 sec is 1 tic (so equivalent to -delay 1). Using -delay 0 produces a much longer animation than using -delay 2.glennrp wrote:Bear in mind that for GIFs, "-delay 0" means "-delay .01 second". coders/gif.c seems to enforce that on writing but not on reading, and animate.c interprets 0 delay as 1 tick..
Using the slow animation above,
Code: Select all
convert -delay 0 animated.gif -coalesce -layers optimize -loop 0 tmp0.gif
Code: Select all
convert -delay 2 animated.gif -coalesce -layers optimize -loop 0 tmp2.gif
Re: Convert animated gif - delay 0 problem
ah, thanks!
/usr/local/bin/convert -delay 2 -loop 0 -background Black -alpha Remove -layers Optimize "$@" ~/Desktop/animated.gif
helped, thanks!
got one last question regarding the output. how can i set the destination of the animated.gif. at the moment ist placed on my desktop, but would be nice if it would be at the same folder as the single frames are in
/usr/local/bin/convert -delay 2 -loop 0 -background Black -alpha Remove -layers Optimize "$@" ~/Desktop/animated.gif
helped, thanks!
got one last question regarding the output. how can i set the destination of the animated.gif. at the moment ist placed on my desktop, but would be nice if it would be at the same folder as the single frames are in
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert animated gif - delay 0 problem
either change directories to the input directory and leave off the path or add the same path to the output gif