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?
davr
Simon Ernst
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
I like this script for automatical sprite/css generation. "Building CSS sprites with Bash & Imagemagick"
来源:https://stackoverflow.com/questions/88711/how-to-concatenate-icons-into-a-single-image-with-imagemagick