Stefan
Stefan

Reputation: 43575

create toolbar imagelist with imagemagick

I'd like to use the ImageMagick convert tool to automatically generate a toolbar bitmap from several png images.

I'm using the following command line:

convert.exe -resize 32x32 @imagelist32.txt +append BMP3:toolbarlarge.bmp

with imagelist32.txt containing a list of png files (each one being one toolbar button).

This works, but the resulting bitmap uses black for the transparent color and white as the background color. I would need both colors to be RGB(192,192,192). Like if there was already an image with that background color, and the png images would be drawn on that background.

How can I do that? I've tried adding the -background #C0C0C0 and -transparent-color #C0C0C0 parameters but it didn't work - maybe I put them in the wrong order?

Upvotes: 3

Views: 281

Answers (1)

TLama
TLama

Reputation: 76663

I know you've probably resolved it by your own, but I've been playing a bit with converter.exe some time ago, so I hope this is what you were looking for.

Set the -alpha parameter to the background flag, what means that every fully transparent pixel will be set to the background color, while leaving it fully transparent. And set also the -background to a certain color RGB(192,192,192), so the previously transparent pixels will get this color.

convert.exe -resize 32x32 -alpha background -background RGB(192,192,192) @imagelist32.txt +append BMP3:toolbarlarge.bmp

Upvotes: 3

Related Questions