Generating x number of pictures

空扰寡人 提交于 2019-12-11 06:36:25

问题


I need to generate pictures with a certain size (in pixels). Each picture will have an incrementing number in it. That is all that will be in the picture, a number. I've been thinking of using photoshop but I have no idea how the scripting works. Any suggestions or examples I could use?


回答1:


Try using ImageMagick (http://www.imagemagick.org) and its text handling feautures (http://www.imagemagick.org/Usage/text/).




回答2:


Here is a way of doing that using 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

And the result:



来源:https://stackoverflow.com/questions/5886027/generating-x-number-of-pictures

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!