Created
July 11, 2013 05:40
-
-
Save unaunagi/5972806 to your computer and use it in GitHub Desktop.
Groovyによる画像加工スクリプトのサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.* | |
import java.awt.* | |
import java.awt.geom.* | |
import java.awt.image.* | |
import javax.imageio.* | |
(1..10).each{ | |
def img = ImageIO.read(new File("face_base.png")); | |
def gr = img.createGraphics(); | |
gr.setColor(Color.white); | |
gr.drawString("face${it}", 1,17); | |
gr.setColor(new Color(0,0,0)); | |
gr.drawString("face${it}", 0,16); | |
gr.dispose(); | |
ImageIO.write(img, "png", new File("face${it}.png")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment