June 2005
Beginner to intermediate
336 pages
6h 29m
English
If the user clicks the Brighten button, Graphicizer brightens the image, as you can see in Figure 3.6.

To brighten an image, you simply multiply the intensity of each pixel. In this case, all you need is a one-dimensional kernel. Here's what the code looks like, complete with Kernel and ConvolveOp objects:
if(event.getSource() == button3){
bufferedImageBackup = bufferedImage;
Kernel kernel = new Kernel(1, 1, new float[] {3});
ConvolveOp convolveOp = new ConvolveOp(kernel);
BufferedImage temp = new BufferedImage(
bufferedImage.getWidth(), bufferedImage.getHeight(),
BufferedImage.TYPE_INT_ARGB); ...Read now
Unlock full access