We often used png & jpeg in our Android projects & sometimes it increases our app size as well.
I heard about webP images and I started exploring what is all about webP images and how we can use it, After learned about it, I thought why not I share with everyone, so let’s gets started…..
WebP is basically an image file format that provides a lossy compression like JPEG, It also provides transparency like PNG.
WebP images supported Android 4.0 (API level 14) and higher.
Best thing About WebP:
The best thing about webP images it’s reduces the image size without reducing the image quality.
How to use It?
Step1: Right click on your image or folder, you will see the option convert to webP like below screenshot.
Step2: Just click on it & then you will see the dialog like below screenshot:
Step3: Adjust the Encoding quality according to your needs. In my case I set the 75% encoded quality & then hit ok button, then you will see the preview screen like the below screenshot.
Now you can see from the above image the png image on the left side and the webP image on the right side.
It reduces the image size from 141.3 KB to 15.4 KB without reducing the image quality.
Convert Back to PNG:
If you want to convert back to png format then again follow the above steps & then you will see the option Convert to PNG.
That’s it. Imagine if you convert all your images in the format of webP how much size of your assets will reduce.
If you want to learn more about webP then check it out the official links below:
Create WebP images | Android Developers
If you selected lossy conversion, and you chose to view a preview of each converted image before saving, Android Studio…
If you want to learn more related to Android then check it out the below link: