Showing posts with label im4java. Show all posts
Showing posts with label im4java. Show all posts

Monday, September 14, 2009

im4javaで直線を描画する

im4javaで直線を描画するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java34
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.size(200, 200);
op.addImage("xc:white");
op.stroke("#7799ff");
op.draw("stroke-width 4 line 0,0,199,199");

op.addImage("sample1341a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


出力画像(sample1341a.png)
im4javaで描画した直線

関連情報
im4javaのまとめ

Tuesday, August 25, 2009

im4javaで画像を早朝っぽく加工する

im4javaで画像を早朝っぽく加工するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java32
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf2.jpg");
op.fill("#bbddff");
op.tint(120.0);
op.addImage("sample1321a.jpg");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf2.jpg)


出力画像(sample1321a.jpg)
im4javaで早朝っぽく加工した画像

関連情報
im4javaのまとめ

Saturday, August 15, 2009

im4javaで濃淡模様が中央に吸い込まれるような画像を作成する

im4javaで濃淡模様が中央に吸い込まれるような画像を作成するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java31
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.size(400, 400);
op.addImage("plasma:fractal");
op.fx("intensity");
IMOperation so1 = op.openOperation();
so1.size(1, 1);
so1.addImage("xc:#3070A0FF");
so1.addImage("xc:#403010FF");
so1.append();
op.closeOperation();
op.fx("v.p{0,p}");
op.implode(1.0);
op.crop(200, 200, 100, 100);
op.addImage("sample1320a.jpg");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


出力画像(sample1320a.jpg)
im4javaで描画した濃淡模様が中央に吸い込まれるような画像

関連情報
im4javaのまとめ

Monday, August 10, 2009

im4javaでjpeg画像のクオリティを設定する

im4javaでjpeg画像のクオリティを設定するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java30
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.quality(10.0);
op.addImage("sample1319a.jpg");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像(sample1319a.jpg)
im4javaでjpegのqualityを設定した画像

関連情報
im4javaのまとめ

Wednesday, August 05, 2009

im4javaでプラズマフラクタル画像を生成する

im4javaでプラズマフラクタル画像を生成するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java29
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.size(200, 200);
op.addImage("plasma:fractal");
op.addImage("sample1318a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


出力画像(sample1318a.png)


関連情報
im4javaのまとめ

Sunday, June 28, 2009

im4javaで画像を点画調に変換する

im4javaで画像を点画調に変換するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java28
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.modulate(100.0, 250.0);
op.sketch(0.0, 10.0, 135.0);
op.spread(1);
op.addImage("sample1122a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像(sample1122a.png)
im4javaで点画調に変換した画像

関連情報
im4javaのまとめ

Wednesday, June 24, 2009

im4javaで画像に枠をつける

im4javaで画像に枠をつけるには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java27
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.bordercolor("#fbfaf7");
op.border(10,10);
op.bordercolor("#918164");
op.border(5,5);
op.addImage("sample1121a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像(sample1121a.png)
im4javaで枠をつけた画像

関連情報
im4javaのまとめ

ImageMagickで枠をつける (convertコマンドでの同様の処理)

Saturday, June 20, 2009

im4javaで英文字列を描画する

im4javaで英文字列を描画するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java26
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.size(200, 200);
op.addImage("xc:white");
op.font("Tahoma");
op.pointsize(50);
op.gravity("center");
op.fill("#7799ff");
op.draw("text 0,0 'im4java'");
op.addImage("sample1120a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


出力画像(sample1120a.png)
im4javaで描画した英文字列

関連情報
im4javaのまとめ

Tuesday, June 16, 2009

im4javaで画像を4色グレースケール画像に変換する

im4javaで画像を4色グレースケール画像に変換するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java25
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.colorspace("gray").colors(4);
op.addImage("sample1119a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像(sample1119a.png)


関連情報
im4javaのまとめ

im4javaで画像をグレースケールに変換する

ImageMagickで画像を4色グレースケールの画像に減色する (convertコマンドでの同様の処理)

Friday, June 12, 2009

im4javaで画像を絵画調に変換する

im4javaで画像を絵画調に変換するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java24
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf2.jpg");
op.spread(1).median(2.0).emboss(1.0);
op.addImage("sample1118a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像2(sf2.jpg)


出力画像(sample1118a.png)
im4javaで絵画調に変換した画像

関連情報
im4javaのまとめ

ImageMagickで画像を絵画風に変換する (convertコマンドでの同様の処理)

Monday, June 08, 2009

im4javaで画像を2値化する

im4javaで画像を2値化するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java23
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.threshold().addRawArgs("55%");
op.addImage("sample1117a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像(sample1117a.png)
im4javaで2値化した画像

関連情報
im4javaのまとめ

Thursday, June 04, 2009

im4javaで画像を傾ける

im4javaで画像を傾けるには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java22
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.shear(10.0,0.0);
op.addImage("sample1116a.png");
convert.run(op);

op = new IMOperation();
op.addImage("sf.jpg");
op.shear(0.0,10.0);
op.addImage("sample1116b.png");
convert.run(op);

}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像1(sample1116a.png)
im4javaで水平方向に傾けた画像

出力画像2(sample1116b.png)
im4javaで垂直方向に傾けた画像

関連情報
im4javaのまとめ

Tuesday, June 02, 2009

im4javaで画像を回転させる

im4javaで画像を回転させるには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.98.0-bin.tar.bz2を解凍してim4java-0.98.0.jarはclasspathに通す
public class Im4java21
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.background("#bbddff");
op.rotate(15.0);
op.addImage("sample1115a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.98
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像(sample1115a.png)
im4javaで回転させた画像

関連情報
im4javaのまとめ

Sunday, May 31, 2009

im4javaで画像のヒストグラムを出力する

im4javaで画像のヒストグラムを出力するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.97.0-bin.tar.bz2を解凍してim4java-0.97.0.jarはclasspathに通す
public class Im4java20
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.addImage("histogram:sample1086a.png");
convert.run(op);

op = new IMOperation();
op.addImage("sf.jpg");
op.channel("b");
op.addImage("histogram:sample1086b.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.97
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像1(sample1086a.png):RGBヒストグラム
im4javaで出力したヒストグラム

出力画像2(sample1086b.png):青チャンネルのヒストグラム
im4javaで出力した青チャンネルのヒストグラム

関連情報
im4javaのまとめ

ImageMagickで、画像のヒストグラムを生成する (convertコマンドでの同様の処理)

Wednesday, May 27, 2009

im4javaで画像に半透明の濃淡をつける

im4javaで画像に半透明の濃淡をつけるには、いかのコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.97.0-bin.tar.bz2を解凍してim4java-0.97.0.jarはclasspathに通す
public class Im4java19
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.seed().addRawArgs("6215");
op.size(200, 200).addRawArgs("plasma:fractal");
op.fx("lightness");
op.alpha("activate").channel("a").fx("r").channel("rgba");
op.addImage("sf.jpg");
op.compose("src_in").composite();
op.addImage("sample1085a.png");
convert.run(op);

op = new IMOperation();
op.size(200, 200).addRawArgs("pattern:checkerboard");
op.addImage("sample1085a.png");
op.composite();
op.addImage("sample1085b.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.97
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}
}


元画像(sf.jpg)


出力画像1(sample1085a.png)


出力画像2(sample1085b.png):半透明濃淡をつけた画像と市松模様の重ね合わせ


関連情報
im4javaのまとめ

ImageMagickで、画像に半透明の濃淡をつけて重ね合わせる

Saturday, May 23, 2009

im4javaで画像にメディアンフィルタをかける

im4javaで画像にメディアンフィルタをかけるには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.97.0-bin.tar.bz2を解凍してim4java-0.97.0.jarはclasspathに通す
public class Im4java18
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.median(3.0);
op.addImage("sample1084a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.97
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}

}


元画像(sf.jpg)


出力画像(sample1084a.png)
im4javaでメディアンフィルタをかけた画像

関連情報
im4javaのまとめ

ImageMagickでメディアンフィルタを適用する (convertコマンドでの同様の処理)

Wednesday, May 20, 2009

im4javaで画像を木炭画調に変換する

im4javaで画像を木炭画調に変換するには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.97.0-bin.tar.bz2を解凍してim4java-0.97.0.jarはclasspathに通す
public class Im4java17
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.charcoal(2);
op.addImage("sample1083a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.97
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}

}


元画像(sf.jpg)


出力画像(sample1083a.png)
im4javaで木炭画調に変換した画像

関連情報
im4javaのまとめ

Saturday, May 16, 2009

im4javaで画像を波型に揺らす

im4javaで画像を波型に揺らすには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.97.0-bin.tar.bz2を解凍してim4java-0.97.0.jarはclasspathに通す
public class Im4java16
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.wave(5.0, 50.0);
op.addImage("sample1082a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.97
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}

}


元画像(sf.jpg)


出力画像(sample1082a.png)
im4javaで波型に揺らした画像

関連情報
im4javaのまとめ

Wednesday, May 13, 2009

im4javaで画像を縮小・タイル配置して回転させる

im4javaで画像を縮小・タイル配置して回転させるには、以下のコードを実行します。


import java.util.*;
import org.im4java.core.*;
import org.im4java.process.*;

// im4java-0.97.0-bin.tar.bz2を解凍してim4java-0.97.0.jarはclasspathに通す
public class Im4java15
{
public static void main(String args[])
throws Exception
{
try
{
// ConvertCmd convert = new ConvertCmd();
ImageCommand convert = new WindowsConvertCmd();

IMOperation op = new IMOperation();
op.addImage("sf.jpg");
op.virtualPixel("tile");
op.distort("SRT", "0.25 45");
op.addImage("sample1081a.png");
convert.run(op);
}
catch(CommandException cex)
{
System.out.println(cex.getErrorText());
cex.printStackTrace();
}
}

// im4java 0.97
static class WindowsConvertCmd extends ImageCommand
{
public WindowsConvertCmd()
{
setCommand("cmd");
setCommand("/c");
setCommand("convert");
/* another way
setCommand("C:\\Program Files\\ImageMagick-6.4.9-Q16\\convert");
*/
}
}

}


元画像(sf2.jpg)


出力画像(sample1081a.png)
im4javaで縮小・タイル配置・回転させた画像

関連情報
im4javaのまとめ

ImageMagickで画像を縮小してタイル配置にして回転させる (convertコマンドによる同様の処理)