Java examples for 2D Graphics:BufferedImage Blur
Blurring a Buffered Image
import java.awt.image.BufferedImage; import java.awt.image.BufferedImageOp; import java.awt.image.ConvolveOp; import java.awt.image.Kernel; public class Main { public static void main(String[] args) { Kernel kernel = new Kernel(3, 3, new float[] { 1f/9f, 1f/9f, 1f/9f,//from www. j a v a 2 s . c om 1f/9f, 1f/9f, 1f/9f, 1f/9f, 1f/9f, 1f/9f}); BufferedImageOp op = new ConvolveOp(kernel); BufferedImage bufferedImage = null; bufferedImage = op.filter(bufferedImage, null); } }