Being Android Developer with every release of the app update, the app size was getting increasing significantly and this was a major concern for me.
I always wanted to minify the app size and make sure the app is delivered at its best level.
Thanks to android studio to come up with the full flexed support of vector drawables with Android 5.0. Also there is a support library 23.4.0 which gives a support for vector drawable from API 7.
Preferred solution is to use ImageZipper – Android Image Compression Library which is an image compression library which helps you to compress your images both in default and custom way. It allows you to control you the width, height, format, orientation and quality of Image. It ease out the task to send images to the server.
I would to share the other way, i keep the images in the app compressed.
- Check if you could covert your image to vector drawable. If yes then don’t think of converting it to the other type, go for it. Here the advantage is you don’t have to create different icons for different dpi’s. One vector drawable will work for all dpi devices. Convert the svg file to vector drawable using vector asset studio in simple steps.
- WebP is supported by your app? WebP is supported from Android 4.0+ version. If yes the go for non-transparent WebP images from 4.0+ and transparent WebP images are supported 4.2.1+. This format is 20% to 30% smaller in size compared to PNG format.
- Use PNG when image needs transparency. this format is best to deal with transparent images. Optimize png image using following options:
- Use online tools to optimize png images. some of the tools are PNGQuant, ImageMagick ,, PNGOut, PNGCrush, OptiPNG, CryoPNG, zopfliPNG, PNG Compressor, PNGOptimizer, PunyPNG, TinyPNG, PNGWolf, Advpng, DeflOpt, Defluff, , TruePNG, PNGnq-s9, Median Cut Posterizer, scriptpng. Using any of these tools will reduce the image size significantly.
- Reduce colors.
4. Go for JPEG format, if you image is of complex format. But make sure you don’t forget to optimize the image size using following options
- Use online tools to optimize jpg images. some of the tools are JPEGMini, packJPG, ImageMagick. This tools reduce the image size significantly.
- Reduce colors.
Hope, this easy steps will help you reduce your images size and will significantly reduce the app size 🙂