How to concatenate icons into a single image with ImageMagick?

Peter Hilton picture Peter Hilton · Sep 18, 2008 · Viewed 19.5k times · Source

I want to use CSS sprites on a web site instead of separate image files, for a large collection of small icons that are all the same size. How can I concatenate (tile) them into one big image using ImageMagick?

Answer

Simon Ernst picture Simon Ernst · May 18, 2012

convert works much better than montage. It arranges images vertically or horizontally and keeps png transparency.

convert *.png -append sprites.png (append vertically)
convert *.png +append sprites.png (append horizontally)