使用 imagemagick 创建工具栏图像列表
我想使用 ImageMagick convert
工具从多个 png 图像自动生成工具栏位图。
我使用以下命令行:
convert.exe -resize 32x32 @imagelist32.txt +append BMP3:toolbarlarge.bmp
imagelist32.txt
包含 png 文件列表(每个文件都是一个工具栏按钮)。
这是可行的,但生成的位图使用黑色作为透明颜色,使用白色作为背景颜色。我需要两种颜色都是 RGB(192,192,192)。就像已经存在具有该背景颜色的图像一样,并且 png 图像将绘制在该背景上。
我怎样才能做到这一点?我尝试添加 -background #C0C0C0
和 -transparent-color #C0C0C0
参数,但它不起作用 - 也许我把它们放在错误的顺序?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道您可能已经自己解决了这个问题,但我前段时间一直在使用 converter.exe,所以我希望这就是您所寻找的。
将
-alpha
参数设置为background
标志,这意味着每个完全透明的像素都将设置为背景颜色,同时保持完全透明。并将
-background
设置为某种颜色RGB(192,192,192)
,这样之前的透明像素将获得这种颜色。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 thebackground
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 colorRGB(192,192,192)
, so the previously transparent pixels will get this color.