2011-05-04 96 views
0

我需要生成具有一定大小(以像素爲單位)的圖片。每張照片都會有一個遞增的數字。這就是圖片中的一切,一個數字。我一直在考慮使用Photoshop,但我不知道腳本是如何工作的。任何建議或例子,我可以使用?生成x張圖片

回答

4

嘗試使用ImageMagick(http://www.imagemagick.org)和文本處理feautures(http://www.imagemagick.org/Usage/text/)。

1

這裏是這樣做,使用ImageMagick的一種方式:

#!/bin/bash 
for i in {0..3}; do 
    echo Generating $i... 
    convert -size 256x256 xc:black \ 
      -gravity south -background orange -splice 0x20 -annotate +0+2 "$i" image-$i.png 
done 

而結果:

enter image description here enter image description here enter image description here enter image description here

+0

我不記得爲什麼我需要這個了,但是謝謝! – Phil 2014-12-12 11:33:22