Page 1 of 1
Convert animated gif - delay 0 problem
Posted: 2015-11-09T02:57:58-07:00
by Der_Kevin
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
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-09T03:14:11-07:00
by snibgo
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.
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-09T03:33:17-07:00
by Der_Kevin
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!
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-09T03:53:49-07:00
by snibgo
This command works fine for me, displaying all 80 frames in about 4 seconds:
Code: Select all
convert -delay 0 -loop 0 frame_*.png -background Black -alpha Remove -layers Optimize a.gif
"-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.
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-09T04:09:49-07:00
by Der_Kevin
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?
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-09T12:12:29-07:00
by fmw42
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
Code: Select all
convert -delay 2 animated.gif -coalesce -layers optimize -loop 0 new_animation.gif
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-09T15:08:13-07:00
by glennrp
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..
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-09T15:53:54-07:00
by fmw42
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..
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.
Using the slow animation above,
Code: Select all
convert -delay 0 animated.gif -coalesce -layers optimize -loop 0 tmp0.gif
the resulting animation plays much slower than
Code: Select all
convert -delay 2 animated.gif -coalesce -layers optimize -loop 0 tmp2.gif
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-10T02:21:54-07:00
by Der_Kevin
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
Re: Convert animated gif - delay 0 problem
Posted: 2015-11-10T10:28:58-07:00
by fmw42
either change directories to the input directory and leave off the path or add the same path to the output gif