Add text into animation at specific frame

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
jlressia

Add text into animation at specific frame

Post by jlressia »

Hi all,
I'm newby with ImageMagik. And I am really surprised with the amount of options that has this tool!
I'm trying to add a text to a GIF at specific frame. But I only get add the text from the beginig.

I'm using a simple line based in the following example..
convert base.gif \
-draw "fill tomato circle 250,30 310,30 \
fill limegreen circle 55,75 15,80 \
font Candice font-size 72 decorate UnderLine \
fill dodgerblue stroke navy stroke-width 2 \
translate 10,110 rotate -15 text 0,0 ' Anthony '" \
draw_mvg.gif

base.gif has 9 frames, and I want add the text into the last 4 frames.

Thank you!!

Kabuby
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Add text into animation at specific frame

Post by fmw42 »

I am not an expert on this, but I believe that you will need to separate the frames, write to the 4 frames you want and then recombine frames back into your animation. see -coalesce to separate the frames and all of Anthony's pages on animation. Also see image sequences and parenthesis processing

http://www.imagemagick.org/Usage/basics/#image_seq

http://www.imagemagick.org/script/comma ... p#coalesce

http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_opt/
http://www.imagemagick.org/Usage/anim_mods/

Anthony may be able to provide a succinct command line to help you when he gets online.
jlressia

Re: Add text into animation at specific frame

Post by jlressia »

Thanks a lot for your reply!!
I will see the links that you sent. I will tell you if I find some solution.

Regards!
Kabuby
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Add text into animation at specific frame

Post by anthony »

The specific link for modifying a single frame in in Animation Modifications
Frame by Frame - modifying one frame at a time
http://www.imagemagick.org/Usage/anim_mods/#frame_mod
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
jlressia

Re: Add text into animation at specific frame

Post by jlressia »

Thanks Anthony!
The example shows exactly that I need to do, but..
I try to run it in Windows..and I can't run it.
I modify the command line like this:

convert sample.gif -coalesce -gravity center -font Verdana -pointsize 24 -fill dodgerblue -stroke navy ^
(-clone 0 -annotate 0 'This') -swap 0 +delete ^
(-clone 1 -annotate 0 'This') -swap 1 +delete ^
-layers OptimizeFrame frame_mod.gif
gif_anim_montage frame_mod.gif frame_mod_frames.gif

And allways I get errors.. I supose, that I'm having troubles with parenthesis, single quotes and double quotes..

Regards!
Kabuby
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Add text into animation at specific frame

Post by fmw42 »

I am not a windows programmer but I think you need spaces after ( and before ) to separate them from the commands
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Add text into animation at specific frame

Post by anthony »

That is exactly right. the parenthesis are separate options you must space separate them form other options.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
jlressia

Re: Add text into animation at specific frame

Post by jlressia »

Yes!! Adding the spaces all works fine!! :D
Thanks a lot!

Kabuby
Post Reply