Skip to content

Instantly share code, notes, and snippets.

@Yuhkiy
Last active November 24, 2016 07:17
Show Gist options
  • Save Yuhkiy/5ccd4dd2cb88752ae4ccbf98de6924a9 to your computer and use it in GitHub Desktop.
Save Yuhkiy/5ccd4dd2cb88752ae4ccbf98de6924a9 to your computer and use it in GitHub Desktop.
class SharpenFilter implements MyFilter {
public BufferedImage processImage(BufferedImage image) {
float[] sharpenMatrix = { 0.0f, -1.0f, 0.0f, -1.0f, 5.0f, -1.0f, 0.0f, -1.0f, 0.0f };
BufferedImageOp sharpenFilter = new ConvolveOp(new Kernel(3, 3, sharpenMatrix),
ConvolveOp.EDGE_NO_OP, null);
return sharpenFilter.filter(image, null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment