Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Resizing images with higher DPI makes them dark

Reply
Thread Tools

Resizing images with higher DPI makes them dark

 
 
Manish
Guest
Posts: n/a
 
      03-21-2007
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

 
Reply With Quote
 
 
 
 
Manish
Guest
Posts: n/a
 
      03-21-2007
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




On Mar 21, 9:47 am, "Manish" <manish.l...@gmail.com> wrote:
> 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



 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      03-21-2007
Manish wrote:
> 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?
>
> On Mar 21, 9:47 am, "Manish" <manish.l...@gmail.com> wrote:
>> 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!


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
 
Reply With Quote
 
Manish
Guest
Posts: n/a
 
      03-21-2007
>
> >> 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


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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
96 dpi x 96 dpi? Boooger Digital Photography 8 11-29-2005 02:46 PM
Accessing higher security level from higher security level nderose@gmail.com Cisco 0 07-11-2005 10:20 PM
JAI funky tiff dpi makes pdf conversion scrunched to half page dwilson Java 0 04-08-2005 06:40 PM
Should File DPI Match Printer DPI? DS Digital Photography 8 07-06-2004 10:25 PM
Higher DPI than 72 RCS Java 6 10-20-2003 11:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57