import groovy.swing.j2d.*
def gr = new GraphicsRenderer()
gr.renderToFile("sample849a.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 {
detectEdges()
}
}
}
元画像(sf2.jpg)

出力画像(sample849a.png)

動作環境
Groovy1.6.0 Beta2, JDK1.6 Update11
関連項目
Java2DとJava Image Filters(pixels)を使用してエッジ抽出をおこなう (Java Image Filtersによる同様の処理)
No comments:
Post a Comment