简体   繁体   中英

How should three images be tiled using ImageMagick montage?

I want to tile three images into a rectangle. Two of the images are to be on the left, on top of each other and set to the same width, and the remaining image is to be on the right.

---------
| 1 |   |
|---| 3 |
| 2 |   |
---------

I know that four images can be tiled using a command of the form following form:

montage 1.png 2.png 3.png 4.png -mode Concatenate -tile 2x2 out.png

---------
| 1 | 2 |
|---|---|
| 3 | 4 |
---------

What would be the right command for tiling the three images?

For the specifics, the full rectangle is of the dimensions 1920 x 1080. Image 1 should be made to fit in 480 x 864 (maintaining its aspect ratio), image 2 is 480 x 216 and image 3 is 1440 x 1080.

-------------
| 1 |       |
|---|   3   |
| 2 |       |
-------------

Like this should work for you:

convert \( 1.png -resize 480x864 \) 2.png -append 3.png +append result.png

在此处输入图片说明

Note that -append will append below, whereas +append will append to the right.

If you want to force image2 to align with the bottom of image3 , you can cause image1 to fill the entire allotted space like this:

convert \( 1.png -resize 480x864 -extent 480x864 \) 2.png -append 3.png +append result.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM