M
Manish
I use following code to resize the uploaded images in our application.
The resizing works fine, but I am getting darker images when I try to
resize images with higher DPI.
BufferedImageOp op = new
AffineTransformOp(AffineTransform.getScaleInstance(mX, mY), new
RenderingHints(RenderingHints.KEY_ANTIALIASING, Boolean.TRUE));
BufferedImage bi = op.filter(img, null);
These are my finidings -
(1) When I upload a larger photo which is 72 dpi, the resizer works
fine. for example, 1280px wide 72 dpi, will resize to 800 wid 72 dpi
and the photo looks fine.
(2) But if the original photo is 300dpi the resizer will convert it to
800 wide 72dpi but the resized photo is VERY dark.
I am wondering what could be causing this and how can I fix this
problem. Any help, pointers wil be highly appreciated!
TIA,
- Manish
The resizing works fine, but I am getting darker images when I try to
resize images with higher DPI.
BufferedImageOp op = new
AffineTransformOp(AffineTransform.getScaleInstance(mX, mY), new
RenderingHints(RenderingHints.KEY_ANTIALIASING, Boolean.TRUE));
BufferedImage bi = op.filter(img, null);
These are my finidings -
(1) When I upload a larger photo which is 72 dpi, the resizer works
fine. for example, 1280px wide 72 dpi, will resize to 800 wid 72 dpi
and the photo looks fine.
(2) But if the original photo is 300dpi the resizer will convert it to
800 wide 72dpi but the resized photo is VERY dark.
I am wondering what could be causing this and how can I fix this
problem. Any help, pointers wil be highly appreciated!
TIA,
- Manish