In my project I read a bitmap picture from assets directory and I want to change the quality of this picture and save it again. I am using this code:
FileOutputStream fos = new FileOutputStream(path);
image.compress(Bitmap.CompressFormat.PNG, 10, fos);
The problem is in second line whether I put 10 or 100, result is the same in terms of pixels of width, height and size of the picture. How can I resize or change a quality?
Thanks
Saving in a compressed format should not by itself change the image dimensions. The quality factor will merely effect the amount of data used to represent an compressed image having the same dimensions as the original.
If you want to rescale it too, you might want to use createScaledBitmap() first.