In my project I need to manipulate a Bitmap and save it.
To manipulate the image I apply a matrix, like this:
Bitmap b = Bitmap.createBitmap(((BitmapDrawable) imageView.getDrawable()).getBitmap(), 0, 0,width, height, matrix, true);
And I save it like this:
b.compress(Bitmap.CompressFormat.JPEG, 100, out);
The problem is that if do that I can get an OOM error if the bitmap is large.
Any suggestion of how to avoid it?
Unfortunately scaling down the Bitmap is not an acceptable solution, because I need to preserve the bitmap quality.