日期:2014-05-20 浏览次数:20795 次
public static void main(String[] args) throws FileNotFoundException, IOException {
BufferedImage img = ImageIO.read(new File("d://1.gif"));//读图片
Kernel kernel = new Kernel(2, 2, new float[] {0.5f,0.5f,0.5f,0.5f});
BufferedImageOp op = new ConvolveOp(kernel);
BufferedImage bufferedImage = op.filter(img, null);
ImageIO.write(bufferedImage, "jpg", new FileOutputStream("d://copy.jpg"));//存图片
}