ImageMagick背景图像?
我最近刚开始探索ImageMagick,我有一个疑问。我一直在寻找,但找不到解决办法 使用以下代码:ImageMagick背景图像?,imagemagick,Imagemagick,我最近刚开始探索ImageMagick,我有一个疑问。我一直在寻找,但找不到解决办法 使用以下代码: convert -background lightblue -fill blue -font Candice -pointsize 30 \ -size 220x220 -gravity Center caption:'$txt' \ $name.gif 如何使用图像作为背景而不是静态颜色 我尝试过-background“file.jpg”但不起
convert -background lightblue -fill blue -font Candice -pointsize 30 \
-size 220x220 -gravity Center caption:'$txt' \
$name.gif
如何使用图像作为背景而不是静态颜色
我尝试过
-background“file.jpg”
但不起作用。使用而不是。使用而不是。根据您追求的效果,有很多方法,但这是一种简单的方法:
convert input.jpg-fill blue-font Candice-pointsize 30-重心-注释+0+0“一些文本”$name.gif
我无法理解这个网站发布代码的方式:(很多方式取决于你所追求的效果,但这是一种简单的方式: convert input.jpg-fill blue-font Candice-pointsize 30-重心-注释+0+0“一些文本”$name.gif
我无法理解该网站发布代码的方式:(我想我误解了你最初的问题。这将在设置大小的背景上平铺图像并添加一些文本
$txt = 'Caption';
// Tile the image - no background as it will not be seen behind the tile
$cmd = " -size 220x220 tile:noise.jpg -font Candice -fill blue -pointsize 30 ".
"-gravity Center -annotate +0+0 $txt";
exec("convert $cmd output.jpg");
我想我误解了你最初的问题。这会将图像平铺到设定大小的背景上,并添加一些文本
$txt = 'Caption';
// Tile the image - no background as it will not be seen behind the tile
$cmd = " -size 220x220 tile:noise.jpg -font Candice -fill blue -pointsize 30 ".
"-gravity Center -annotate +0+0 $txt";
exec("convert $cmd output.jpg");
我曾尝试用-background“file.jpg”替换-background“file.jpg”by-texture“file.jpg”,但它带有白色背景我曾尝试用-background“file.jpg”by-texture“file.jpg”替换-background“file.jpg”,但它带有白色背景在OS X上使用shell中的ImageMagick时,必须指定字体的完整路径。
convert-size 220x220 tile:/Applications/Chess.app/Contents/Resources/selected\u piece\u texture.png-填充蓝色-字体/库/字体/Arial\slown.ttf-点大小30-重心-注释+0+0“一些文本”output.png
。在OS X上使用shell中的ImageMagick时,必须指定字体的完整路径。convert-size 220x220 tile:/Applications/Chess.app/Contents/Resources/selected\u piece\u texture.png-fill blue-font/Library/font/Arial\shown.ttf-pointsize 30-重心-注释+0+0“某些文本”输出.png
。