I am creating a simple android app to view a comic book. The pages are large(0.5-1 mb each), high quality .png's and I am loading them into a webview to make use of the built in zoom controls. So far I only have 17 files and the APK size is already about 16 mb. I'm looking to add over 200 files in future updates. I can't really reduce the quality too much because there is small text that must be zoomed-in on to read. Any suggestions? A similar question was posted here: How to reduce App (.apk) Size, but I don't want to lose the quality of the images. I'm not sure if it's appropriate to link to here, but you can have a look at my app by searching for Tracer (by Detour Mobile) on the android market if it helps at all. Thanks in advance.
3 Answers
You could compress them without using lossy compression- e.g. zipping/rarring them, but I don't believe this would gain you much more than a few kilobytes here and there. Otherwise, try using a more compact format than PNG, such as JPEG (you won't lose too much quality.) By the way, all of this was suggested in the referenced post.
If you do decide to scale down the images' size somewhat, be sure to use a method like bicubic sharper- it tends to look better than others when reducing image size.
Another option would be to download the images for the comic that is being read on-the-fly with pre-fetching so reading would not be interrupted as much.

- 6,993
- 4
- 43
- 51
-
Thank you, I think I'll try using JPEGs first. I was just afraid of losing too much quality and the small text being unreadable. Very helpful answer :) – Amplify91 Oct 05 '10 at 15:51
-
2If the comics are black & white, you may try to convert them into GIF. GIF is a good choice as image format if the amount of colors is low (like 255 or less), because GIF will only try to reduce the palette size and only index colors which are actually used. So if the number of colors is 255 or less, you could put 1 pixel into 1 byte, while for BMP you usually need 4 bytes per pixel. I think this could greatly reduce black&white comic pages – Tseng Oct 05 '10 at 17:51
Consider placing your images in Assets folder as opposed to Res. The big difference is, Assets content won't be compiled into R.java class so you will see major storage savings. You'd have to modify your code though as you won't be able to call up the images via the regular r.resID notation, but it's doable

- 11
- 3
android offers a new way to deal with it. android app bundle apk size has a maximum size of 150mb but you can use an asset pack to seperate the apk from the static files and upload your app
here is a more detailed explanation about asset packs: https://developer.android.com/guide/playcore/asset-delivery
here is the guide for integrating asset packs with regular android app: https://developer.android.com/guide/playcore/asset-delivery/integrate-java

- 26
- 1