I have a number of tiff images of documents, some black & white, some color, that I apply a blur to, using a 'convolve' operation.
My images start out as either 1 bit per pixel or 8 bits per pixel but after the 'convolve' they are all 24 bits per pixel. The subsequent tiff images are significantly larger than the ones I started with.
Here is the code that applies the blur:
public static RenderedImage blur(RenderedImage image, int radius) {
int klen = Math.max(radius, 2);
int ksize = klen * klen;
float f = 1f / ksize;
float[] kern = new float[ksize];
for (int i = 0; i < ksize; i++)
kern[i] = f;
KernelJAI blur = new KernelJAI(klen, klen, kern);
ParameterBlockJAI param = new ParameterBlockJAI("Convolve");
param.addSource(image);
param.setParameter("kernel", blur);
return JAI.create("Convolve", param, null);
}
Any idea how to perform the blur without changing the bits per pixel?
Thanks.
David
[Message sent by forum member 'dpjones' (
dpjones@...)]
http://forums.java.net/jive/thread.jspa?messageID=365156---------------------------------------------------------------------
To unsubscribe, e-mail:
interest-unsubscribe@...
For additional commands, e-mail:
interest-help@...