Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/368.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Text imagemagick将文本作为实心背景上的孔_Text_Background_Imagemagick_Transparent - Fatal编程技术网

Text imagemagick将文本作为实心背景上的孔

Text imagemagick将文本作为实心背景上的孔,text,background,imagemagick,transparent,Text,Background,Imagemagick,Transparent,我只是想用IM创建一些文本作为图像。 我希望图像的大小自动调整为文本长度。 此外,我需要的背景颜色是一个固体指定的颜色(rgb 166127000在这个例子中),文字颜色是“透明的”。我指的是背景上的文本“作为洞” 我可以通过以下命令获得它: /opt/local/bin/convert \( -font /fonts/myFont.ttf -pointsize 25 -background none -fill 'rgb(166,127,000)' -gravity center +antia

我只是想用IM创建一些文本作为图像。 我希望图像的大小自动调整为文本长度。 此外,我需要的背景颜色是一个固体指定的颜色(rgb 166127000在这个例子中),文字颜色是“透明的”。我指的是背景上的文本“作为洞”

我可以通过以下命令获得它:

/opt/local/bin/convert \( -font /fonts/myFont.ttf -pointsize 25 -background none -fill 'rgb(166,127,000)' -gravity center +antialias label:'TEST'   \)  -channel a -separate +channel -negate -fill  -alpha set -channel RGBA -fill none -opaque black -fill 'rgb(166,127,000)' -opaque white  png:-
我正在寻找一种更简单的方法。此外,我有问题与反别名和文本看起来太大

多谢各位