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 ...
随机推荐
- wp8 ListPicker
如何给selectedindex 绑定SelectedIndex="{Binding User.StationWorkFlag}" 这样写不对嘛 为何提示我 SelectedIn ...
- 以app形式启动chrome——关于chrome命令行
转自:http://wiselyman.iteye.com/blog/2179043 转自:http://bbs.ithome.com/thread-589651-1-1.html 转自:http:/ ...
- eclipse 中的 jar file 和 runnable jar file的区别
转自于:http://blog.csdn.net/lijiecong/article/details/6266234 java最难学的就是角落的东东了,不愧叫做java平台.搜索了一把总算明白了. 直 ...
- C#学习笔记(九)——集合、比较和转换
一.集合 ** System.Collections名称空间中的几个接口提供了基本的集合功能 Ps:这里看成一个动态的链表,但是已经完美的封装好了. (一)使用集合 1.代码示例 (1)Animal. ...
- android 自定义相机画面倒立解决方案
有部分手机的影像是倒立的,如何解决这个问题呢? 请看下面 public static void setCameraDisplayOrientation(Activity activity, int c ...
- IDEA中如何使用Maven进行打包。 IDEA版本是14
说实话,找了好半天的资料,也许是我的IDEA版本太高了网上资料稀缺,所以愣是没有找到打包的方法,只是自己瞎琢磨了,还好搞出来了,记录一下. 说文字说一下大概流程,其实很简单: 创建配置文件->创 ...
- 启动mysql出现了error the server quit without updating pid file (/var/lib/mysql/localhost.localdomain.pid)
原来是我的mysql日志太多,所以去/data/log/mysql目录(这个目录是从/etc/my.cnf中的log-error确定的)下删除了 rm -rf mysql_binary_log.*的日 ...
- win7下loadrunner创建mysql数据库参数化问题解决
问题现象: 安装mysql数据源驱动后,lr创建mysql驱动程序列表没有安装的驱动程序: 安装完mysql ODBC数据源后 2.在控制面板-数据源(ODBC) 3.创建mysql数据源: 4.从l ...
- 2016.7.9 计算机网络复习要点第四章之网际控制报文协议ICMP
1.ICMP允许主机或路由器报告差错情况和提交有关异常情况的报告:为了更有效地转发IP数据报和提高交付成功的机会: 2.ICMP不是高层协议,因为ICMP报文是装在IP数据报中的,作为其中数据部分,所 ...
- windows 并发与同步 学习笔记
测试 5.2 windows 中断与异常 1.外部硬件中断是通过处理器上的中断引脚管或者本地APIC的内置模块来发生的:对于一个处理器,一旦被中单, 某个预先被设定的中断服务例程就被执行! 2.处理器 ...