Batch Animate

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
jmphoto
Posts: 1
Joined: 2012-11-27T22:48:30-07:00
Authentication code: 6789

Batch Animate

Post by jmphoto »

Hi guys,

I've done a fair bit of research, but haven't found anything that answers my specific query, so here goes with my first post.

Is it possible to harness the power of IM to do a batch animation. Specifically I want to create an animated GIF photobooth, but am trying to get my head around the 'how'.

My thoughts would be that the booth would take 4 frames, named sequentially. Starts with IMG001, IMG002, IMG003 and IMG004. Then there would be a break of at least 30 seconds or so before the next round of photos would be taken, presumably would then be IMG005, IMG006, IMG007 and IMG008, but in theory could be named IMG001, IMG002, IMG003 and IMG004 again after moving the original files.

If it isn't possible to animate the 4 frames as they drop into the folder from the camera, would it be possible to write a command that I could run that could separate [IMG001, IMG002, IMG003, IMG004] as one animaton and then [IMG005, IMG006, IMG007, IMG008] and so on?

It is probably clear as mud, and I apologise. Hope this is posted in the correct place.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch Animate

Post by fmw42 »

It should be possible to do most if not all you want, if I understand correctly. But you may have to build a script to watch the folder. So what version of IM do you have and what platform? Syntax and scripting is different between unix(linux,mac) and windows.

See
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_opt/
http://www.imagemagick.org/Usage/anim_mods/
http://www.imagemagick.org/script/animate.php

basic animation command

convert -dispose xxx -delay yyy image1 image2 image3 image4 -loop 0 result.gif

or if your folder only has the images that you want in it and no others (all previous ones deleted), then

convert -dispose xxx -delay yyy image* -loop 0 result.gif


The issue that is outside of IM where the scripting comes in is to watch the folder and take action at appropriate times.
Post Reply