Types of compression algorithms
http://www.html5rocks.com/en/tutorials/speed/img-compression/
Types of compression algorithms
There are generally two stages in an image compressor, a lossy phase, and lossless phase. Lossy compression algorithms will modify the source stream such that you lose information that cannot be restored upon decompression.Most lossy algorithms in image compression take advantage of how the human visual system works, often removing information that we really can’t see, and in the process, saving bytes. For example, limiting the colors used in an image; fewer colors means there’s less data to run around. Generally, when you save an image in a format supporting Lossy compression, you’re asked what “quality level” you’d like for the image, effectively, what you’re choosing is a scalar value which trades file-size for image-quality. Savvy web developers realize that there is a sweet-spot for images, such that the quality level is high enough, and the file size is low as possible.
| Before | After |
| 0.123, 1.2345, 21.2165, 21.999, 12.123 | 0,0,20,20,10 |
Figure 1 - An example of lossy compression. Values are quantized to the smallest multiple of 10 they occupy. This transform cannot be reversed.
After a lossy compressor, a lossless variant is then applied, that is, the data, once uncompressed, is restored to it’s exact state, before compression. These are typical compression algorithms that allow the source stream to be recovered directly without any loss of precision or information. In Images, popular Lossless codecs include LZ77, RLE, and Arithmetic encoding. Lossless compression algorithms are the backbone of compression, often squeezing out the last percentages of data from your content, constantly struggling with information theory to reduce your data sizes.
| Before | After |
| aaaaabbbbbcccddddeeeeffffaaaaabb | a5b4c2d4e4f4a5bb0 |
Figure 2 - An example of lossless compression. Runs of values are encoded as the symbol followed by the length of the run. We can properly restore the origional stream. Note that if the length of the run is <= 2 characters, it makes sense to just leave the symbols alone. You see this at the end of the stream with ‘bb’.
小结:
0-可还原性,可逆性。
发问:
0-从0101层面考虑呢?
Types of compression algorithms的更多相关文章
- 【面试笔试算法】Program 4 : Best Compression Algorithms(网易游戏笔试题)
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 易信是由网易和电信联合开发的一款即时通讯软件.除了语音聊天,免费电话等新功能以外,传统的文字信息聊天功能也得以保留,因此每 ...
- MySQL 5.6 Reference Manual-14.7 InnoDB Table Compression
14.7 InnoDB Table Compression 14.7.1 Overview of Table Compression 14.7.2 Enabling Compression for a ...
- Codeforces 650C Table Compression
传送门 time limit per test 4 seconds memory limit per test 256 megabytes input standard input output st ...
- codeforces Codeforces Round #345 (Div. 1) C. Table Compression 排序+并查集
C. Table Compression Little Petya is now fond of data compression algorithms. He has already studied ...
- MongoDB 3.0 WiredTiger Compression and Performance
MongoDB3.0中的压缩选项 在MongoDB 3.0中,WiredTiger为集合提供三个压缩选项: 无压缩 Snappy(默认启用) – 很不错的压缩,有效利用资源 zlib(类似gzip) ...
- Codeforces Round #345 (Div. 1) C. Table Compression dp+并查集
题目链接: http://codeforces.com/problemset/problem/650/C C. Table Compression time limit per test4 secon ...
- Code Forces 650 C Table Compression(并查集)
C. Table Compression time limit per test4 seconds memory limit per test256 megabytes inputstandard i ...
- Codeforces Round #345 (Div. 2) E. Table Compression 并查集
E. Table Compression 题目连接: http://www.codeforces.com/contest/651/problem/E Description Little Petya ...
- codeforces 651E E. Table Compression(贪心+并查集)
题目链接: E. Table Compression time limit per test 4 seconds memory limit per test 256 megabytes input s ...
随机推荐
- 计数排序算法——时间复杂度O(n+k)
计数排序 计数排序是一个非基于比较的排序算法,该算法于1954年由 Harold H. Seward 提出.它的优势在于在对一定范围内的整数排序时,它的复杂度为Ο(n+k)(其中k是整数的范围),快于 ...
- 修改Tomcat编码方式的两种方法
转自:http://blog.sina.com.cn/s/blog_7c76d63901018lyt.html 方法一:推荐,不会影响到其它项目 见我的另一篇博客:http://www.cnblog ...
- andorid开发易范的错误
1 写DAO,调用远程API接口返回不来数据,实际这个api接口经过第三方工具测试通过的,原因是没有放到线程里.
- chrome扩展程序开发之在目标页面运行自己的JS
大家都知道JS是运行在客户端的,所以,如果我们自己写一个浏览器的话,是一定可以往下载下来的网页源代码中加入js的.可惜我们没有这个能力.不过幸运的是,chrome的扩展程序可以帮我们做到这件事. 本文 ...
- Linux常用命令_(基本命令)
基本命令:ls.cd.pwd.man 1.ls 打印当前目录下的文件和目录文件 用法详解:: ls [-alFR] [文件或目录] -a 显示所有文件,包括隐藏文件:[root@qmfsun]#ls ...
- Spring的类型转换器
spring有2种类型转换器,一种是propertyEditor,一种是Converter. 第一种属性编辑器用法见Spring的属性编辑器的章节.如果2种转换器都适用,那么究竟会适用哪种呢?Spri ...
- 转:.NET获取当前方法名或调用此方法的方法名
Introduction Before .NET, we were always looking for a way to log current method name in a log file ...
- ANSYS:Negative pivot encountered
做柔性体仿真,从ANSYS导入模态中性文件时有这个报错. Negative pivot encountered. This is likely caused by insufficient disp ...
- extjs 动态添加item
<html> <p> </p> <head> <title>测试页面</title> <meta http-equiv=& ...
- LA 4080 (多源最短路径+边修改+最短路径树)
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=32266 题目大意:①先求任意两点间的最短路径累加和,其中不连通的边 ...