【问题标题】:add text to image with convert使用转换将文本添加到图像
【发布时间】:2017-12-12 00:10:33
【问题描述】:

我被一些使用 bash 命令的图像编辑所困。 我有 414 张图像标记为 1file.png 2file.png ... 414file.png。我想为其中的每一个添加数字,该数字已经存在于名称中。我们的目标是创建一个 .gif 文件,它将显示一个角落的图像数量。 (使用 convert * result.gif 创建 .gif 有效)

问题是它不会在图像中添加我的号码,而是直接打印 $i。有人知道如何读取循环变量吗?

我试过了:

for i in {0..9}; do
convert -pointsize 80 -fill black -draw 'text 1650 400 "$i"' "$i"file.png "$i"file.png;
done

提前非常感谢。

【问题讨论】:

    标签: bash loops unix imagemagick-convert quoting


    【解决方案1】:

    问题解决了:

    for i in {0..1}; do
    convert -pointsize 80 -fill black -draw 'text 1650 400 '\"$i\"'' "$i"file.png "$i"file.png;
    done
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-25
      • 1970-01-01
      相关资源
      最近更新 更多