Resizing images with higher DPI makes them dark

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
 
M

Manish

Interestingly, when I resize photo on my local machine (Windows XP) -
there is no darkening. But when we test this on our server - it is
turing very dark (Linux box) - so I am wondering if there is any
property/configuration that I can tweak to get this working?

- Manish
 
L

Lew

Manish said:
Interestingly, when I resize photo on my local machine (Windows XP) -
there is no darkening. But when we test this on our server - it is
turing very dark (Linux box) - so I am wondering if there is any
property/configuration that I can tweak to get this working?

A: It makes the posts hard to read.
Q: Why is it bad?
A: Placing the reply above the quote to which one is replying.
Q: What is top-posting?

-- Lew
 
M

Manish

A: It makes the posts hard to read.
Q: Why is it bad?
A: Placing the reply above the quote to which one is replying.
Q: What is top-posting?

-- Lew

Got it!! I will keep that in mind - I thought it makes it easier to
read as the most latest is on top.
Any useful inputs here?


- Manish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top