Android Question Write large bitmap in sections to file?

Robert Valentino

Well-Known Member
Licensed User
I use to build a bitmap in memory (writing bitmaps to a canvas in sections Upper Left, Upper Right, Lower Left, Lower Right)
Then I would BitmapPlus to Rescale the image to 66% of its size and use it again to Reduce the Colors.
Finally I would write the file out using the GIF library because it wrote the smallest file (JPG and PNG were bigger)

The problem I have now the bitmap I am trying to create is 5078 x 806 and could be twice that size if the user selects a lot of options. Which is WAY out of memory.

How can I build a bitmap to a file using as little memory as possible?

Is there anyway after building to a file to rescale it without reading it in? (reduce colors would also be nice)

Convert it to GIF would be nice as well (for some reasons lower JPG and PNG options made the file not as nice to look at)

Thanks for any help