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 really like the file size reduction that I saw in my png files to carry over to my app size. please help
In the Google Photos app, head to settings and select Free up device storage. Keep your photos, but get rid of the space they take up. After you see the calculation for how much space will be opened up, go ahead and select Delete.
In android the best format of Image is PNG as it light compare to JPG,JPEG etc.So its easy to draw and take less time to perform the operation while using these images.
PNG crunching is now a BuildType property and is disabled by default on debug builds. Note: crunching is basically used for png images filter. Follow this answer to receive notifications.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With