Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge Images Side by Side(Horizontally)

Tags:

imagemagick

I have five images of sizes: 600x30, 600x30, 600x30, 600x30, 810x30. Their names are: 0.png, 1.png, 2.png, 3.png, 4.png, respectively.

How do I merge them Horizontally to make an image of size 3210x30 with ImageMagick?

like image 271
Sasuke Kun Avatar asked Dec 23 '13 04:12

Sasuke Kun


People also ask

Can you merge two PNG files?

How to merge PNG to PNG file. Open a browser in PNG free application web site and go to the Merger tool. Click inside the file drop area to upload PNG files or drag & drop a PNG files. Click the 'MERGE' button to start merging files.


2 Answers

ImageMagick ships with the montage utility. Montage will append each image side-by-side allowing you to adjust spacing between each image (-geometry), and the general layout (-tile).

montage [0-4].png -tile 5x1 -geometry +0+0 out.png 

Other examples can be found on Montage Usage page

like image 166
emcconville Avatar answered Oct 13 '22 05:10

emcconville


ImageMagick has command line tool named 'convert' to merge images horizontally, or for other purpose. i have tried this command and working perfectly on your case:
To join images horizontally:
convert +append *.png out.png

To stack images vertically:
convert -append *.png out.png

like image 31
tesmojones Avatar answered Oct 13 '22 07:10

tesmojones