Technology Epic

Network Security

Image Compression for Android Developers

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.

Image result for image compression

Best Solution

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.

  1. 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.
  2. 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.
  3. Use PNG when image needs transparency. this format is best to deal with transparent images. Optimize png image using following options:

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 JPEGMinipackJPGImageMagick. 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 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Online Codes © 2017