如何通过命令行在 Imagemagick 中创建空白的新图像?
Using -background
不起作用:
$ convert -size 800x800 -background white x.png
convert: no images defined `x.png' @ error/convert.c/ConvertImageCommand/3257.
白色背景
convert -size 800x800 xc:white white.png
xc:
过去的意思是“X Constant Image”,但现在只是一个简写canvas:
。这意味着您还可以使用:
convert -size 800x800 canvas:white white.png
因为如果没有提供颜色,“白色”是默认值,所以您还可以使用:
convert -size 800x800 xc: white.png
convert -size 800x800 canvas: white.png
透明背景
如果“空白”是指“透明”,则只需使用该词作为颜色:
convert -size 800x800 xc:transparent transparent.png
答案由ImageMagick v6 示例 http://www.imagemagick.org/Usage/canvas/#solid and 如何打造新形象? http://www.imagemagick.org/discourse-server/viewtopic.php?t=11747
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)