import org.codehaus.groovy.scriptom.*
Scriptom.inApartment
{
im = new ActiveXObject("ImageMagickObject.MagickImage.1")
// 回転した余白の色は-backgroundで指定します。
im.convert("sf.jpg", "-background", "#bbddff", "-rotate", "10",
"sample1078a.png")
// 回転した余白の色を透明にしたい場合は、noneを指定します。
im.convert("sf.jpg", "-background", "none", "-rotate", "10",
"sample1078b.png")
}
元画像(sf.jpg)
出力画像1(sample1078a.png)

出力画像2(sample1078b.png)

動作環境
Groovy1.6.0, JDK1.6 Update12, ImageMagick6.5.0, Microsoft VC++ 2008 Redistributable
※ImageMagickインストール時にCOMインターフェイスも入れておくこと。
No comments:
Post a Comment