-1

I'm looking for a java library to use in my project that allows to increase the resolution of a given image. Specifically, if it matters, I'm working with android Bitmap objects. Obviously, nothing like identifying the bad guy from a reflection on a guy's eye or anything, but I would like to take say a 50x50 picture and turn it into a 100x100 picture. Obviously this isn't simple at all, but I'm looking for a library / API the will handle all the interpolation / algorithms for me.

It should preferably be simple to use, as what I'm looking is more practical and less academic / scientific.

Nate
  • 30,286
  • 23
  • 113
  • 184
Gal
  • 5,338
  • 5
  • 33
  • 55
  • Increasing in resolution is easy -- it's called resizing and every image library I've ever used can do this. I'd rephrase this question to request "a decent interpolation algorithm suitable for upsizing". My personal recommendation is Lanczos, it's fairly good for upsizing. – Chris Eberle Dec 23 '11 at 20:58
  • You can find a possible solution here: http://www.anddev.org/android-2d-3d-graphics-opengl-problems-f55/resizing-a-bitmap-t14882.html#p45718 – Yury Dec 23 '11 at 21:50

2 Answers2

1

getScaledInstance is part of the basic image package, but the best answer is probably to not do it. drawImage can be used to scale the image to fill the destination rectangle.

ddyer
  • 1,792
  • 19
  • 26
0

Unfortunately the 'enhance button' functionality you've seen on CSI doesn't exist in real life. The best you're going to get is resizing the image.

When you decode the bitmap with the BitmapFactory, pass in a BitmapFactory.Options object and specify inSampleSize. This is the best way to save memory when decoding an image.

Here's a sample code: Strange out of memory issue while loading an image to a Bitmap object

Community
  • 1
  • 1
Graham
  • 993
  • 6
  • 19
  • Ah, it does exist; it's called super resolution. I'm just looking for a java library to do it for me. – Gal Dec 23 '11 at 21:07