import groovy.swing.j2d.*
def gr = new GraphicsRenderer()
gr.renderToFile("sample827a.png", 300, 225){
 antialias("on")
 rect( x: 0, y: 0, width: 300, height: 225,
   borderColor: no){
   texturePaint(x: 0, y: 0, file: 'sf2.jpg' )
   filters {
     kaleidoscope(sides:6, angle:20, angle2:50,
       centreX:0.5, centreY:0.5, radius:100)
   }
 }
}
元画像(sf2.jpg)

出力画像(sample827a.png)

動作環境
Groovy1.6.0 Beta2, JDK1.6 Update11
関連項目
Java2DとJava Image Filters(pixels)を使用して万華鏡のような画像を生成する
 
No comments:
Post a Comment