public static void main(String[] args) throws IOException{ //调用的时候指定相关参数 AbstractBufferedImageOp bbf = new BoxBlurFilter((float)4,(float)3,3); System.out.println(System.getProperty("user.dir") + "\\test.jpg"); //读取图片 File f = new File(System.getProperty("user.dir") + "\\test.jpg"); BufferedImage src = ImageIO.read(f); //生成图片 BufferedImage dst = null; dst = bbf.filter(src, dst); //图片输出 ImageIO.write(dst, "jpeg", new File(System.getProperty("user.dir") + "\\test111.jpg")); }
在论坛的帖子里面发现一个用于对图片进行滤镜处理的包
刚开始,下载了也不知道怎么用(可能因为我是菜鸟吧),研究了一下,写了一个调用的Demo,记下方便以后使用吧
http://www.jhlabs.com/ip/filters/index.html
相关包的下载地址为:点击进入下载