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 数据压缩入门
147
第 12章
压缩图像数据
如果你是一名应用程序开发人员,那么很有可能你的应用程序的绝大部分内容是图像数据。
社交流媒体、购物网页,甚至是地图信息,所有这些图像内容都必须
不断地
发送给用户。
图像压缩是一个非常棘手的问题,包含在压缩工具中的每个有损压缩算法都很复杂(最乐
观地看),还是不要接触的好。不过也不要放弃希望,虽然这些压缩工具大多数情况下被当
作黑盒系统,你的开发团队仍然可以做很多事情来影响图像内容的大小,使它变得更小。
12.1
 理解图像质量与文件大小
通常来说,图像压缩工具会提供一个整数参数,让你来决定图像的质量。
1
随着这个值变小,图像的大小也会变小,当然质量也会变差。
你知道,这个值主要是用来控制有损算法为了压缩效果更好,而在转换数据时采取的力
度。更差的质量就意味着有更多的颜色被丢弃,或者是有更多的边缘信息被忽略,所有这
些都是为随后的统计编码阶段生成更多的重复符号。
选定这样一个值,可以说是一项重大的、关键的、耗时的决定。如果这个值选得过小,就
会造成图像伪影,用户也可能抱怨图像质量差;如果这个值选得过大,那么发送的图像就
比需要的大得多,相应的费用也会增加不少。图
12-1
2
展示了这一过程。
注
1
:
或许你对这个概念有所了解,当在
Photoshop
软件中保存
JPG
文件时,它通常会询问你想要什么样的
“质量等级”。
注
2
:
图
12-1
的彩色图片,请通过本书图灵社区页面(
https://www.ituring.com.cn/book/1893
)的“随书下载”
处获取。——编者注
148
|
第
12 ...
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

Publisher Resources

ISBN: 9787115534170