android – 由于图像而造成的大型应用大小.如何压缩.PNG图像?

android – 由于图像而造成的大型应用大小.如何压缩.PNG图像?,第1张

概述我开发的应用程序有很多图像可以工作,因为我的应用程序的大小已经变得非常大.我想压缩或类似的东西来减少应用程序的大小.任何想法? 在编译您的应用程序时,放置在res / drawable中的.png文件为 automatically optimized: Bitmap files may be automatically optimized with lossless image compressi 我开发的应用程序有很多图像可以工作,因为我的应用程序的大小已经变得非常大.我想压缩或类似的东西来减少应用程序的大小.任何想法?解决方法 在编译您的应用程序时,放置在res / drawable中的.png文件为 automatically optimized:

Bitmap files 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. So be aware
that the image binarIEs placed in this directory can change during the
build. If you plan on reading an image as a bit stream in order to
convert it to a bitmap,put your images in the res/raw/ folder
instead,where they will not be optimized.

话虽如此,你还有更多的选择.来自Google I / O 2016的“Image Compression for Android Developers”的这个话题有很好的发言,它概述了可能性,解释了他们的不足之处,并给出了一些一般的最佳实践.

如果您的应用程序的大小要高于市场上的发布,那么您也可以

>发送您的应用程序没有图像,并将它们从互联网加载到手机SD卡时,应用程序第一次启动
>使用AndroID本身的APK Extension Files,这基本上是一样的,但你不必自己做一切.

总结

以上是内存溢出为你收集整理的android – 由于图像而造成的大型应用大小.如何压缩.PNG图像?全部内容,希望文章能够帮你解决android – 由于图像而造成的大型应用大小.如何压缩.PNG图像?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1132825.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存