import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import com.jhlabs.composite.*;
import com.jhlabs.image.*;
public class Java2DTest76
{
public static void main(String args[])
throws Exception
{
/* 扇形に変形 */
BufferedImage img = ImageIO.read(new File("sf.jpg"));
BufferedImage imga = new BufferedImage(
img.getWidth(), img.getHeight(),
BufferedImage.TYPE_INT_ARGB
);
CircleFilter cf = new CircleFilter();
cf.setHeight(80);
cf.setAngle(2 * ImageMath.PI * -10 / 360);
cf.setSpreadAngle(2 * ImageMath.PI * 160 / 360);
img = cf.filter(img, imga);
ImageIO.write(img, "png", new File("sample1977a.png"));
}
}
元画像(sf.jpg)
出力画像(sample1977a.png)
関連項目
Jerry Huxtableさんのホームページ
http://www.jhlabs.com/index.html
Java Image Filtersのページ
http://www.jhlabs.com/ip/filters/
java.net でのプロジェクトページ
https://pixels.dev.java.net/
No comments:
Post a Comment