I need to scale a large (8+ megapixel) image taken with the camera app, down to about 3 megapixels. Unfortunately, I cannot use the beloved Bitmap.createScaledBitmap()
function since in order to load the 8M image Android needs to allocate about 32 megabytes of (continuous) RAM memory. This immediately throws an OutOfMemoryError.
People suggested I use native code to do the scale, but this is too much work for this project. Does someone have any other suggestions?
I wonder if I can somehow use RenderScript to achieve this result, although I'm very doubtful.
Thanks!
Update: Implementation of Bitmap.createScaledBitmap()
.