indicating the passage of time in a file.gif

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
Federico P
Posts: 3
Joined: 2011-10-15T08:32:08-07:00
Authentication code: 8675308

indicating the passage of time in a file.gif

Post by Federico P »

Hello everybody, :D

I run a simulation of an Astrophysical problem and et the end i've a lot of file.png .
So i decided to create a file.gif with the following command :

Code: Select all

 convert -delay 20 -loop 0 rho.*.png animation.gif 
Now i want to put some object that indicates the passage of time in my gif. Is it possible to do this ??????? :? :? :?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: indicating the passage of time in a file.gif

Post by Bonzo »

Something like a clock or the time from the photo EXIF data?
Federico P
Posts: 3
Joined: 2011-10-15T08:32:08-07:00
Authentication code: 8675308

Re: indicating the passage of time in a file.gif

Post by Federico P »

something like the bar to the right of this movie:

http://jila.colorado.edu/~pja/images/planet.mpg

or the time to the right, on the top of this gif:

http://www.astro.cf.ac.uk/research/star ... g.disc.gif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: indicating the passage of time in a file.gif

Post by fmw42 »

just compute the time using the frame number and the delay, then label your image with that number. You may have to write a loop to do the labeling from the individual (-coalesced) frames knowing how much delay you are using or going to use to regenerate the animation.

see
http://www.imagemagick.org/script/comma ... 3#coalesce
http://www.imagemagick.org/script/escape.php (see %n and %s)
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_basics/#coalesce
http://www.imagemagick.org/Usage/anim_opt/
http://www.imagemagick.org/Usage/anim_mods/
http://www.imagemagick.org/Usage/text/

This one shows you how to add a label under your frames:
http://www.imagemagick.org/Usage/anim_mods/#label


Try this:
convert -delay 100 rose: rose: rose: rose: -loop 0 rose.gif

convert rose.gif -coalesce \
-gravity South -background white -splice 0x18 \
-annotate 0 'Time %[fx:t*100]' \
-layers Optimize rost_labeled.gif

see
http://www.imagemagick.org/script/fx.php
Federico P
Posts: 3
Joined: 2011-10-15T08:32:08-07:00
Authentication code: 8675308

Re: indicating the passage of time in a file.gif

Post by Federico P »

Thanks so much for your answer. I used your command and I finally do my work. 8)

Thanks so much, really.
Post Reply