Glueing tile images together using imagemagick's montage command without resizing

和自甴很熟 提交于 2019-12-02 15:46:07
kch

I was looking to do something similar and ended up here (I guess your "as many keywords as possible" thing worked). Here's what I came up with that worked for me. (geometry and tile adjusted for your needs)

montage -border 0 -geometry 660x -tile 3x3 tile* final.jpg

The files get added to the tiles horizontally, so, for -tile 4x2, the disposition would be:

1 2 3 4
5 6 7 8

The numbers being the relative positions of the filenames in the argument list.

As far as I can tell, tile* will expand alphabetically, so you should either specify your filenames manually, or rename then so that they'll sort appropriately, e.g.:

# top row
tile_r0_c0.jpg
tile_r0_c1.jpg
tile_r0_c2.jpg
# middle row
tile_r1_c0.jpg
tile_r1_c1.jpg
tile_r1_c2.jpg
# bottom row
tile_r2_c0.jpg
tile_r2_c1.jpg
tile_r2_c2.jpg
BearCode

Dave's solution didn't work for me, so I found a better answer here. Try this:

montage -mode concatenate -tile 3x3 tile*.jpg result.jpg

it also works without the second "3"

montage -mode concatenate -tile 3x tile*.jpg result.jpg

the complete line for Windows users is:

"C:\Program Files\ImageMagick-6.8.0-Q16\montage.exe" -mode concatenate -tile 3x tile*.jpg result.jpg

(change the "6.8.0-Q16" with your own version of ImageMagick, of course)

I personally use this minimal command for such tasks:

montage tile*.jpg -tile 3x3 -geometry +0+0 output.jpg

geometry +0+0 will not add any border and conserve the original size of each image (a very much advised option).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!