Martin Frey wrote:

Hi
does someone know how to antialias a bufferedimage?
i need to print my canvas3d and i thought i would be great if it can
be antialiased before printing.
else the printing works very fine.

thanks Martin
You could use a filter to perform an averaging across your buffered image:

import java.awt.image.ConvolveOp;
import java.awt.image.Kernel;

// SNIP

float blur = 0.05f;
float left = 1.0f - (8.0f * blur);

float[] BLUR3x3 = {blur, blur, blur,    // low-pass filter
                             blur, left, blur,
                             blur, blur, blur};
BufferedImage filtered = new
BufferedImage(SRC_IMAGE_WIDTH,SRC_IMAGE_HEIGHT,BufferedImage.TYPE_INT_RGB);
Kernel kernel = new Kernel(3,3,BLUR3x3);
ConvolveOp cop = new ConvolveOp(kernel,
                           ConvolveOp.EDGE_NO_OP,
                           null);
cop.filter(srcImage,filtered);


Kev

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to