append animation - windows 7

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
sidora
Posts: 3
Joined: 2015-10-31T05:56:43-07:00
Authentication code: 1151

append animation - windows 7

Post by sidora »

Hi,

I use imagemagick to append animation frames, and just switched from mac to windows.

On mac i used to list all frame numbers in a curly bracket like this:
convert animation_{0,1,2,3,4,5,6,7,8,9,10,11,12}.png -append animation.png

On windows this doesnt work. i get an error.

i tried this on windows: convert animation_[0-12].png -append animation.png

But this only seems to work for 0 to 9 (10 frames max).

Most of my animations are hundreds of frames and i would like a good way to append without listing the frames one by one (e.g. animation_1.png animation_2.png etc)

Does anyone knows a good way to easily append a list of numbered files? Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: append animation - windows 7

Post by snibgo »

I think curly brackets {a,b,c} is a feature of bash that Windows cmd doesn't have. You can install bash and other Unix tools on Windows, if you want, from Cygwin.

I always use leading zeros in frame names. I use six digits as five isn't enough for one hour.

For example, generating frames, Windows BAT syntax:

Code: Select all

for /L %%N in (0,1,19) do (

  set LZ=000000%%N
  set LZ=!LZ:~-6!

  convert rose: fr_!LZ!.png
)
Reading frames, bash syntax:

Code: Select all

convert fr_{000007,000008,000009,000010,000011}.png +write info: f.tiff

fr_000007.png[0] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.001
fr_000008.png[1] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.002
fr_000009.png[2] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.002
fr_000010.png[3] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.003
fr_000011.png[4] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.003
snibgo's IM pages: im.snibgo.com
sidora
Posts: 3
Joined: 2015-10-31T05:56:43-07:00
Authentication code: 1151

Re: append animation - windows 7

Post by sidora »

Installed Bash, and now the curly brackets works :) Thanks!

i really wish something like this: convert animation_[0-127].png would work..
Would be so easy:P
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: append animation - windows 7

Post by snibgo »

I think the [a-b] expansion is by ImageMagick. It would be useful if it worked for multi-digit numbers. Perhaps it is supposed to, but has a bug.

In bash, we can use {a..b}, eg:

Code: Select all

convert fr_{7..11}.png +write info: f.tiff

fr_7.png[0] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.002
fr_8.png[1] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.001
fr_9.png[2] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.003
fr_10.png[3] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.006
fr_11.png[4] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.008

convert fr_{000007..000011}.png +write info: f.tiff

fr_000007.png[0] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.002
fr_000008.png[1] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.003
fr_000009.png[2] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.005
fr_000010.png[3] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.008
fr_000011.png[4] PNG 70x46 70x46+0+0 8-bit sRGB 0.000u 0:00.009
snibgo's IM pages: im.snibgo.com
sidora
Posts: 3
Joined: 2015-10-31T05:56:43-07:00
Authentication code: 1151

Re: append animation - windows 7

Post by sidora »

snibgo wrote:I think the [a-b] expansion is by ImageMagick. It would be useful if it worked for multi-digit numbers. Perhaps it is supposed to, but has a bug.

In bash, we can use {a..b}, eg:

Code: Select all

convert fr_{7..11}.png +write info: f.tiff

Nice!! Thanks a lot!
Post Reply