如何使用imagemagick为照片添加描述?

时间:2017-01-20 06:28:56

标签: imagemagick image-manipulation

我想在此照片中添加说明:

enter image description here

所以它看起来像这样:

enter image description here

我使用的命令是:

montage -pointsize 14 -gravity NorthWest  -title "\nName: $filename\nOrigin:$origin \n Price:$price "  input.png output.png

但我得到了:

我该如何解决这个问题?我需要在条纹的左上角出现不超过图像整体高度20%的条纹吗?

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以这样做:

#!/bin/bash
name="Flower"
origin="Moon"
price="£3.99"
magick flower.jpg -size "%[fx:w/4]x%[fx:h/4]" caption:"Name: $name\nOrigin: $origin\nPrice:$price" -trim +swap -append result.jpg

this