ImageMagick - 使用-distort创建具有透明背景的弯曲文本

时间:2017-04-28 04:28:08

标签: imagemagick

我有这样的命令:

  

转换-font Tahoma -pointsize 20标签:'环游世界' \
             - 虚拟像素背景 - 背景SkyBlue \
            -distort Arc 60 arc_circle_1.png

该命令将创建一个图像:enter image description here

文字的背景是白色的,我希望它是透明的。我怎样才能做到这一点? Tkanks。

1 个答案:

答案 0 :(得分:0)

通常,您可以通过设置 undercolor 来实现这一点,如下所示:

convert -undercolor magenta -font Tahoma -pointsize 20 label:' Around the World ' -virtual-pixel Background -background SkyBlue -distort Arc 60  arc_circle_1.png

enter image description here

但由于某些原因,当您将次要颜色设置为nonetransparent时,这不起作用,因为您无法透支而无法制作某些内容。

我可以建议的一点是,您使用默认的白色底色来创建图像,然后使白色透明:

convert -font Tahoma -pointsize 20 label:' Around the World ' -virtual-pixel Background -background SkyBlue -distort Arc 60 -fuzz 20% -transparent white arc_circle_1.png

enter image description here

如果您的图像中有白色,只需将底色设置为fucshia或非常对比的东西,然后将该颜色设置为透明。

相关问题