import groovy.swing.j2d.*
def gr = new GraphicsRenderer()
gr.renderToFile("sample865a.png", 200, 200){
antialias("on")
rect( x: 0, y: 0, width: 200, height: 200,
borderColor: no){
texturePaint(x: 0, y: 0, file: 'sf.jpg' )
filters {
posterize(numLevels:8)
}
}
}
元画像(sf.jpg)
出力画像(
sample865a.png
)![groovyでポスタライズした画像](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicr_bUYTVxvR2u2m0Dq7BmaQdHBDOwY4TtcS98Ot-LgR6S7Xvp2lCgQ-jSoTw-zJ8G9_fdmDETBodiQNRlxPvvEgIeY30Vac6l85YL_kfrZKQYIouFtYhCLLiJZWP4JFuoHGPS/s320/sample865a.png)
動作環境
Groovy1.6.0 Beta2, JDK1.6 Update11
関連項目
groovyで画像の彩度を上げる
No comments:
Post a Comment