1

I am having an bitmap image to which I am scaling down again and again . But the problem occurring is that the image quality is decreasing as I am scaling down. What should I do to keep the image quality as it is.

Jagdeep Singh
  • 1,200
  • 1
  • 16
  • 34

2 Answers2

0

If you need scaled image for saving it somewhere, then scale it just once.

If you want to display scaled image then use matrices instread. For example ImageView class has a method named setImageMatrix().

Dmitry Zaytsev
  • 23,650
  • 14
  • 92
  • 146
0

It looks like a cumulative problem :)

1) Scale from original (largest) image. 2) I am not shure about algorithm used by Bitmap.scalledBitmat, but it is fast and I think, that it returns first discrete pixel which is near position.

So if you can ceonserve quality you will need to do resizing manualy.

Fo example you have an array with 3. point and you need to rescale to array contains 2. point.

Fist point is calculated as dest[0] = (1*src[0]+0.5*src[1])/1.5.

This is in 1D. you need to make 2D algorithm.

Achiles
  • 122
  • 5