Sharpening a Buffered Image - Java 2D Graphics

Java examples for 2D Graphics:BufferedImage Effect

Description

Sharpening 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[] argv) throws Exception {
    BufferedImage bimage = null;//w  w w.j a  v  a  2s . c  o  m
    Kernel kernel = new Kernel(3, 3, new float[] { -1, -1, -1, -1, 9, -1, -1,
        -1, -1 });
    BufferedImageOp op = new ConvolveOp(kernel);
    bimage = op.filter(bimage, null);
  }
}

Related Tutorials