For any number of input files
named in-<something>.jpg
:
convert -append in-*.jpg out.jpg
In order to have specific files appended, or skip numbers instead of getting the full "glob", you can mention the input files explicitly and put the append
command afterwards
convert in-1.jpg in-5.jpg in-N.jpg +append out-in1-plus-in5-and-inN.jpg
You can use -append
(instead of +append
) for vertical paste-up.
Or:
montage -mode concatenate -tile 1x in-*.jpg out.jpg
will also create a file out.jpg
that contains a vertical concatenation of the source images.
convert
For simple concatenation in a single row or column, the append
option of the convert
tool is sufficient. Note that -append
concatenates all images vertically, creating one column with n rows,
and +append
concatenates horizontally, creating one row with n columns.
(See ImageMagick: Command-line Options.)
montage
To get finer control over the layout, we would need the montage
tool. montage -mode concatenate
will glue the input images together like the append
option and -tile 1x
controls the layout to be applied.
tile
follows the format columns×rows, but either side may be missing and montage
will figure out how to meet the constraints.
We're using 1x
(exactly one column with any number of rows) here to get the same effect as -append
. Without -tile 1x
, it would join the images like +append
, defaulting to -tile x1
(any number of columns on one row).
(See ImageMagick Examples: Montage, Arrays of Images.)
You can use a free tool called ImageMagick. It can tell you how many images are in the GIF.
identify -format %n~%f\n *.gif
1~120406-00.gif
1~120406-01.gif
1~autonumbering.gif
%n number of images in current image sequence
%f filename (including suffix)
\n newline
The 1 is front indicates how many frames are in the image.
Anything more than 1 we can assume is an animated GIF.
Best Answer
GIMP can work with gif files, they appear just like normal images but each frame in their own layer.
If you're looking for a programmable solution, I've had good experiences with ImageMagick.
Best of all, both are free and open source! :-)