• Post Reply Bookmark Topic Watch Topic
  • New Topic

image resolution

 
Brendan Kennedy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey
how do you check and then change the resolution of a BufferedImage?
Thanks,
Brendan
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know, if this is possible. Probably not. If you want to change something with your image, then you should have a look on JAI Java Advanced Imaging. They can do a lot. It is a good API.
 
Brendan Kennedy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying
I did sort of(there's still some kinks) come up with a method that uses bufered image though. I can check the width in pixels using the SampleModel, then check the widthheight of the bufferedimage(they don't give you units but I'm guessing this is in either cm or mm. So if I want an x resolution of 160 ppi(pixels per inch)I convert the width to inches, divide this number into my current resolution to get the x ppi. I then use an AffineTransform to make a buffered image 160/x times smaller and then an AffineTransformOp to make the image the desired size. This is done in conjunction with the same operatoin for the height.
My maths could be off as I only came up with that last night and I haven't really looked to deeply into it this morning. Also there's obviously going to be some sort of round off error due to haveing to convert form int to double and back...
Could you please give me some links to some JAI/JIMI tutorials?
Regards,
Brendan
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAI has it's homepage under JAI home
There you can find JAI itself and some tutorials and demos.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!