Blurring a Buffered Image - Java 2D Graphics

Java examples for 2D Graphics:BufferedImage Blur

Description

Blurring a Buffered Image

Demo Code

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);

  }
}

Related Tutorials