WebP image format in Android

Vishwanath.M picture Vishwanath.M · Dec 20, 2017 · Viewed 7.9k times · Source

I have below doubts on webP

Can i convert and use all PNG/JPEG images in project to WebP format .?

or is there is specific PNG/JPEG images only i can convert to WebP format and use it Project like only banner images .?

Answer

Lokesh Desai picture Lokesh Desai · Dec 20, 2017

Yes you can convert all PNG/JPEG to WebP format. There is no rule that only banner image can convert to WebP format.If you really concern about your application's apk size than it is good practice to convert images to WebP which you are using in your project.

Issue which you might face when converting image into WebP format as i have already faced:

If you are already using .webp images in your project, lint will check for two things: If you minSdkVersion is less than 15, you can't use .webp (unless the .webp image is in a -v15 folder or higher.) If your minSdkVersion is less than 18, it looks at the actual contents of the .webp files and if it finds that it is using transparency or lossless encoding, it emits a warning that this requires API 18. (Again, placing these folders in a -v18 or higher folder is fine.)

Most important is:

WebP is an image file format from Google that provides lossy compression (like JPEG) as well as transparency (like PNG) but can provide better compression than either JPEG or PNG. Lossy WebP images are supported in Android 4.0 (API level 14) and higher, and lossless and transparent WebP images are supported in Android 4.3 (API level 18) and higher.

You can find this notes from this link also

Hope this can clear your doubt if still any doubt you can ask here.