|
Thanks Chris. This article helped me greatly. I have added a blur before the do while loop. To me, then, the quality is very very close to a photoshop resize. I guess its in the eye of the beholder.
if (higherQuality) {
// Setup blur convolve before resizing
float weight = 1.0f/9.0f;
float[] elements = new float[9];
for (int i = 0; i < 9; i++) {
elements[i] = weight;
}
Kernel blurKernel = new Kernel(3, 3, elements);
ConvolveOp blur = new ConvolveOp(blurKernel);
tmp = new BufferedImage(w, h, type);
blur.filter(ret, tmp);
ret = tmp;
}
|