关于安卓图像显示比iOS差的原因(英文文档)

简介: There are so many comparations between Android phone and iPhone. We cannot make the conclusion about which one is better, bu...
There are so many comparations between Android phone and iPhone. We cannot make the conclusion about which one is better, but we all knows that the image quality of Android phone is much worse than iPhone. No matter you are using Facebook, Twitter or even Instagram, after taking the photo, adding a filter, then sharing to the social network, the images produced by Android phone are always coarse. Why? 
 Our team had been working on this issue in the last year. After very deep research, we found that this was a "TINY" mistake made by Google. Although tiny, but the influence was very huge (all Android Apps related to image), and lasted till today. 
 The problem is : libjpeg. 
 We all know that libjpeg is widely used open source JPEG library. Android also uses libjpeg to compress images. After digging into the source code of Android, we can find that instead of using libjpeg directly, Android is based on an open source image engine called Skia. The Skia is a wonderful engine maintained by Google himself, all image functions are implemented in it, and it is widely used by Google and other companies' products (e.g.: Chrome, Firefox, Android......). The Skia has a good encapsulation of libjpeg, you can easily develop image utilites base on this engine. 
 When using libjpeg to compress images, optimize_coding is a very important parameter. In libjpeg.doc, we can find following introductions about this parameter: 
 boolean optimize_coding
TRUE causes the compressor to compute optimal Huffman coding tables
for the image.  This requires an extra pass over the data and
therefore costs a good deal of space and time.  The default is
FALSE, which tells the compressor to use the supplied or default
Huffman tables.  In most cases optimal tables save only a few percent
of file size compared to the default tables.  Note that when this is
TRUE, you need not supply Huffman tables at all, and any you do
supply will be overwritten.
 
 As the libjpeg.doc, we now know that because setting the optimize_coding to TRUE may cost a good deal of space and time, the default in libjpeg is FALSE. 
 Everything seems fine about the doc, and libjpeg is very stable. But many people ignored that this document was writen for more than 10 years. At that time, space and computing abilities are very limited. With today's modern computers or even mobile phones, this is not an issue. On the contrary, we should pay more attention to the image quality (retina screens) and image size (cloud services). 
 Google's engineers of skia project did not set this parameter, so the optimize_coding in Skia was remained to FALSE as the default value, and Skia concealed this setting, you could not change the setting outside of Skia. This became to a big problem, we had to endure worse image and bigger file size. 
 Our team had tested optimize_coding for many different images. If you want the same quality of image compressing, the file size are 5-10 times bigger when setting the optimze_coding to FALSE than to TRUE. The difference is quite significant. 
 We also compared the jpeg compressing between iOS and Android (they both concealed the optimize_coding parameter). With the same original images, if you want same quality level, you need 5-10 times file size on Android. 
 The result is clear, Apple does know the importance of optimize_coding and Huffman tables and Google does not. (Apple uses their own Huffman table algorithm, not like libjpeg or libjpeg-turbo. It seems that Apple has done more tuning works on image compressing.) 
 Finally, we decided not to use JPEG compress functions provided by Android, and we compiled our own native library based on libjpeg-turbo (libjpeg-turbo also has performance improvements). Now we can save 5-10 times of image space and enjoy the same or even better image quality. This work is totally worth to do. 
 Thanks for reading, :) 
 Our project on github: https://github.com/bither
目录
相关文章
|
4天前
|
编解码 Android开发 iOS开发
探索iOS与安卓应用开发的差异性与交互设计哲学
在移动应用开发的广阔天地中,iOS和安卓这两大操作系统不仅塑造了市场的双雄争霸格局,更在开发者社区内激发了关于“最佳实践”的热烈讨论。本文将深入探讨这两个平台在技术架构、用户界面设计以及市场策略上的根本差异,揭示它们如何影响应用的性能、用户体验和商业成功。通过比较分析,我们将展现每个平台的独特优势,并为开发者提供战略性建议,以便在不同生态系统中实现最大化的产品潜力和用户满意度。
|
2天前
|
移动开发 Java Android开发
探索iOS与安卓应用开发的核心差异
【6月更文挑战第22天】在移动开发的广阔天地中,iOS和安卓这两大平台以其独特的特性和用户基础塑造了不同的开发生态。本文将深入探讨这两个平台在开发环境、编程语言、用户界面设计、性能优化以及发布流程方面的关键差异,为开发者提供实用的比较视角,并指出各自平台的特有优势和面临的挑战。了解这些差异有助于开发者更精准地定位自己的应用开发策略,实现跨平台的成功。
|
3天前
|
Java 开发工具 Android开发
安卓与iOS开发差异解析
【6月更文挑战第21天】本文旨在深入探讨安卓和iOS两大移动操作系统在应用开发过程中的主要差异。通过对比分析,揭示各自的设计哲学、编程语言选择、用户界面构建、性能优化策略以及发布流程的异同。文章将提供开发者视角下的实用信息,帮助他们更好地理解各自平台的特点和挑战,从而做出更明智的开发决策。
|
4天前
|
Java 开发工具 Android开发
探索安卓与iOS开发的核心差异
【6月更文挑战第20天】在移动应用开发的广阔天地中,安卓和iOS两大平台各自占据半壁江山。本文将深入探讨这两大操作系统在开发过程中的主要区别,包括编程语言、开发工具、用户界面设计哲学、系统架构以及市场分布等方面。通过对这些关键差异的分析,旨在为开发者提供一份实用的指南,帮助他们在面对项目决策时,能够更加明智地选择合适的平台,并针对特定平台优化他们的应用。
|
4天前
|
开发工具 Android开发 iOS开发
探索安卓与iOS开发的差异:从工具到用户体验
【6月更文挑战第20天】在移动应用开发的广阔天地中,安卓和iOS两大平台各自占据半壁江山。本文将深入探讨这两个操作系统在开发环境、编程语言、用户界面设计以及性能优化等方面的关键差异。我们将通过比较分析,揭示各自平台的独特优势和面临的挑战,为开发者提供决策参考,并为最终用户提供更深层次的用户体验洞察。
|
22小时前
|
Java 开发工具 Android开发
Android Studio 导出JavaDoc文档
Android Studio 导出JavaDoc文档
|
23小时前
|
安全 搜索推荐 Android开发
探索安卓和iOS系统的优劣与特点
在移动操作系统领域,安卓和iOS一直是最热门的两个选择。本文将探讨安卓和iOS系统的优劣与特点,帮助读者更好地了解这两个操作系统,并为选择合适的移动设备提供参考。
5 0
|
3天前
|
安全 Android开发 iOS开发
探索安卓与iOS开发的差异:平台特性与用户体验的对比分析
移动应用开发的两大阵营——安卓与iOS,各自拥有独特的开发环境、用户群体和市场定位。本文将深入探讨这两个操作系统在应用开发过程中的主要差异,包括编程语言、开发工具、用户界面设计、性能优化、安全性考量以及发布流程等方面。通过比较分析,旨在为开发者提供跨平台开发的见解和策略,以优化应用性能和提升用户体验。
9 0
|
Android开发
Android 图像压缩
Android中图片是以Bitmap形式存在的,Bitmap所占内存直接影响应用所占内存大小,Bitmap所占内存大小计算公式: 图片长度 * 图片宽度 * 一个像素点占用的字节数 Bitmap压缩颜色格式: 图1.
815 0
|
4天前
|
安全 Java Android开发
安卓开发中的新趋势:Kotlin与Jetpack的完美结合
【6月更文挑战第20天】在不断进化的移动应用开发领域,Android平台以其开放性和灵活性赢得了全球开发者的青睐。然而,随着技术的迭代,传统Java语言在Android开发中逐渐显露出局限性。Kotlin,一种现代的静态类型编程语言,以其简洁、安全和高效的特性成为了Android开发中的新宠。同时,Jetpack作为一套支持库、工具和指南,旨在帮助开发者更快地打造优秀的Android应用。本文将探讨Kotlin与Jetpack如何共同推动Android开发进入一个新的时代,以及这对开发者意味着什么。