Question

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?

Was it helpful?

Solution

From the page you linked, 'montage' is the tool you want. It'll take a bunch of images and concatenate/tile them into a single output. Here's an example image I've made before using the tool: alt text
(source: davr.org)

OTHER TIPS

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)

You are looking for:

montage -background transparent -geometry +4+4 *.png sprite.gif
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top