开发者

android png optimization

I have an app that using alot of .png fils, so to reduce app size I used PngOptimizer to optimze them. I was happy with the results and the file size of the png's went from alittle over 1mb to 300kb or so. but for some reason the app size only went down about about 100kb. doesn anyone know why? I would rea开发者_如何学Pythonlly like the file size reduction that I saw in my png files to carry over to my app size. please help


Your .APK application files already get compressed using the deflate algorithm. That is the same algorithm used by PNG files.

So the optimization you've done with the PngOptimizer has already been done to some extend by the .APK packer.

If you want to reduce the size of your application you should either reduce the color-depth of your PNG files (this helps a lot) or switch to .JPG files where possible. These could - depending on what the image contains - be smaller.


PNG files in res/drawable are automatically compressed using a palette if possible.

From http://developer.android.com/guide/topics/graphics/2d-graphics.html#drawables :

Note: Image resources placed in res/drawable/ may be automatically optimized with lossless image compression by the aapt tool during the build process. For example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit PNG with a color palette. This will result in an image of equal quality but which requires less memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜