您可以直接从命令行或从 C/C++、Perl、Python、PHP 等使用 ImageMagick。
从convert 开始,得到一个 100 像素 x 100 像素的白色正方形。
convert -size 100x100 xc:white circles.jpg
根据需要更改颜色或文件扩展名,例如
convert -size 200x200 xc:black circles.gif
现在添加两个中心为 50,50 的圆
convert -size 100x100 xc:white \
-draw "circle 50,50,60,50" \
-draw "circle 50,50,70,50" \
circles.jpg
\ 只是一个续行。
现在回到我的办公桌前......所以,这是一个命令:
#!/bin/bash
convert -size 400x400 xc:white -fill transparent \
-stroke gray90 -draw "circle 200,200,260,200" \
-stroke gray80 -draw "circle 200,200,280,200" \
-stroke gray70 -draw "circle 200,200,300,200" \
-stroke gray60 -draw "circle 200,200,320,200" \
-stroke gray50 -draw "circle 200,200,340,200" \
-stroke gray40 -draw "circle 200,200,360,200" \
-stroke gray30 -draw "circle 200,200,380,200" \
-stroke gray20 -draw "circle 200,200,400,200" \
circles.jpg
结果:
也许你可以用 Java 执行它:
Runtime.exec(...)