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.)
This command will take any sized input file and fit it best to a 40x40 square and pad with transparency:
convert \
original.png \
-thumbnail '40x40>' \
-background transparent \
-gravity center \
-extent 40x40 \
-compose Copy_Opacity \
-composite mask.png \
original-resized.png
The gravity
option ensures the image is centered in both directions, and transparent
is used wherever there are no pixels. Then the compositing is done with the mask.png
Best Answer
Imagemagick is a complex tool with a lot of options.
In the example you posted it seems that to the first image is superimposed (overlapped) a copy flipped with some transparency level. All actions that you can do at the price of a complicate commandline.
Let's suppose, for sake of simplicity, that you have just ready the two images. Give it a look to [1],[2] to understand better how it works. In the second reference [2] you can have a guess by examples about the methods available in Imagemagick to add two images.
Probably the
-dissolve
[3] or the-blend
[4] option is what you are searching for:Another way to do it can be [5]
Additional operation may have to be added to scale the image if needed... As additional reference you can see [n]. See again this page [5] for some examples.
In general the syntax of the
dissolve
option can be similar to the following one: