June 2005
Beginner to intermediate
336 pages
6h 29m
English
You can also use Graphicizer to blur an image by clicking the Blur button. You can see the results in Figure 3.7, where the image has an out-of-focus look.

To blur an image, the code will simply combine the pixels surrounding a particular pixel. Here's what this looks like using a Kernel object and a ConvolveOp object:
if(event.getSource() == button4){
bufferedImageBackup = bufferedImage;
Kernel kernel = new Kernel(3, 3, new float[]
{.25f, 0, .25f,
0, 0, 0,
.25f, 0, .25f});
ConvolveOp convolveOp = new ConvolveOp(kernel);
BufferedImage temp = new BufferedImage(
bufferedImage.getWidth(), bufferedImage.getHeight(), ...Read now
Unlock full access