How to concatenate icons into a single image with ImageMagick?
-
01-07-2019 - |
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?
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
I like this script for automatical sprite/css generation. "Building CSS sprites with Bash & Imagemagick"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow