import groovy.swing.j2d.*
def gr = new GraphicsRenderer()
gr.renderToFile("sample863a.png", 200, 200){
  antialias("on")
  rect( x: 0, y: 0, width: 200, height: 200,
    borderColor: no){
    filters {
      scratch(angle:10, angleVariation:0.8,
        color: color("#c0c0c0"), density:0.9,
        length:0.5, width:0.5, seed:2009)
    }
  }
}
出力画像(sample863a.png)

動作環境
Groovy1.6.0 Beta2, JDK1.6 Update11
関連項目
groovyで画像に放射ブラーをかける
groovyで画像に編み目模様をつける
 
No comments:
Post a Comment