Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Resizing images with higher DPI makes them dark

Thread view: 
Manish - 21 Mar 2007 05:47 GMT
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
Manish - 21 Mar 2007 11:02 GMT
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

> 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
[quoted text clipped - 17 lines]
> TIA,
> - Manish
Lew - 21 Mar 2007 13:33 GMT
> 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
[quoted text clipped - 19 lines]
>> I am wondering what could be causing this and how can I fix this
>> problem. Any help, pointers wil be highly appreciated!

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
Manish - 21 Mar 2007 16:03 GMT
> >> I am wondering what could be causing this and how can I fix this
> >> problem. Any help, pointers wil be highly appreciated!
[quoted text clipped - 5 lines]
>
> -- 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.