Skip to Content
数据压缩入门
book

数据压缩入门

by Colt McAnlis, Aleks Haecky
April 2020
Intermediate to advanced
210 pages
4h 47m
Chinese
Posts & Telecom Press
Content preview from 数据压缩入门
152
|
第
12
章
12.1.3
 让想法真正工作
显然,为了让用户感受到相同的视觉品质,不同类型的图像需要有不同的输出设定。一
张森林的照片由于有很多边缘和不同的颜色,因此需要更多的二进制位以充分地展示它;
而一张手绘的卡通,因为其颜色简单,所以不会产生很多的渐变问题。因此,不同的图
像类型,需要使用不同的输出设定。然而,如何在开发环境中实现它,这个问题留给你
来解决。
显而易见,通过云端的计算资源反复寻找找出理想的质量设定是最简单的方法,但并不是
所有的开发人员都有时间和经费做到这一点。
12.2
 图像的尺寸很重要
在现今的移动世界,有很多屏幕尺寸不同、处理能力各异的设备。这对开发人员来说是一
个很大问题:在处理图像时应该使用什么样的分辨率?
考虑这样一个场景,一位用户正在用手机上传一张
800
万像素的照片。
5
对那些屏幕分辨率与上传用户相同的用户来说,有理由相信他们希望看到的是同样大小的
照片,可是应该如何应对那些屏幕分辨率只有一半或者四分之一的用户呢?这与从桌面显
示器上和手机屏幕上看图像时的差别类似。显然,更小的屏幕会使用更小的物理像素显示
图像,因为它拥有的物理像素就少,那么应该在什么地方调整大小呢?
将全分辨率的图像发送到设备上,在渲染前再调整大小,对开发人员来说,这样做肯定最
省事,但缺点也很明显,我们将用户不需要(也不会看)的数据发给了他们。这样做,其
实是把钱往水里扔,还听不到一个响。
更好的方法是直接在云端调整图像的大小,或者在某处缓存调整大小后的图像,这样就能
向小屏幕发送小尺寸的图像。这并非遥不可及。很有可能 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
解密金融数据

解密金融数据

Justin Pauley
神经网络算法与Java编程

神经网络算法与Java编程

Posts & Telecom Press, Fabio M. Soares, Alan M. F. Souza

Publisher Resources

ISBN: 9787115534170