http://www.html5rocks.com/en/tutorials/speed/img-compression/

https://developers.google.com/speed/webp/

Image Formats

An image format typically chains together various lossy + lossless algorithms to grant compression savings. There’s multiple formats adopted by web browsers, each with different features and performance tradeoffs. To be clear, there’s not a “one size fits all” format for the web (currently). Different types of images should be encoded into different formats depending on what type of image it is, what the browser supports, and what needs the page has.

There’s typically three decisions that go into the choice of an image format for a web developer.

  • Does it need transparency?
  • Does it need animation?
  • Does it need high quality data?
'Lena' is a common image used in the evaluation and comparision of image compression algorithms.

PNG is a simple format that supports transparency and lossless compression. It allows you to define an alpha channel for your image, to mask out transparent areas, as well as an option to enable a lossless Deflate compressor on the data. (Deflate is a combination of two lossless compressors, LZ77, and Huffman). Because compression is lossless, image quality remains identical to the source image, this causes issues however, in that the file sizes tend to be quite bloated, and not as small as they could be.

GIF is another format which supports transparency, alongside animation (which is the direct reason for the whole ‘cats on the internet’ thing..). The GIF format contains two stages of compression, a lossy palletization step (restricting the entire image to only 256 colors) followed by a lossless LZW compressor. The process of quantizing the colors of the image down to only 256 provides an aggressive quality reduction at the benefit of better compression sizes, which tends to produce better compression from the LZW end of things.

Colt McAnlis says: Most modern, cutting edge compressors make the largest wins by chaining together multiple coding steps. A single stage can modify the data stream such that subsequent stages can compress it better than the raw data stream alone. Popular encoders, like 7zipchain together LZ dictionary encoding, that produces a reduced set of symbols that can be consumed more efficiently by a Markov Chain algorithm.
Or, for example, you can apply a lossless compression algorithm on top of an existing, GPU formatted lossy format to encode the data even further. The biggest wins come from combining algorithms in the right ways.

If you don’t need transparency, or animation, then JPG is the best format for you. It was generally designed to handle the compression of high-quality photo data, but provides a configurable set of Lossy compression options, allowing you to trade off compression quality vs. image size as your application needs it.

If you’re looking for more of a ‘one stop shop’ for your image format, then WebPshould be on your radar. The format boasts not only superior compression quality/size, but also transparency and animations as well. It uses both a lossy and lossless compressor combination, and much like JPG, will allow you to define your quality level vs. file size. Of course, this new image format hasn't been adopted across all browsers just yet, so web developers who’ve adopted it are currently in the early phases of working through usability issues. Although a 30% savings over JPG, alongside increased server-side adoption prove that WebP is a dominant format for any sites dealing with image bloat problems.

  Compression Lossless Lossy Transparency Animation
PNG Good Yes No Full No
GIF OK Yes Yes Binary Yes
JPG Good Yes Yes No No
WebP Great Yes Yes Full Yes

Figure 3 - Feature set for specific browser supported formats

WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.

Lossy WebP compression uses predictive coding to encode an image, the same method used by the VP8 video codec to compress keyframes in videos. Predictive coding uses the values in neighboring blocks of pixels to predict the values in a block, and then encodes only the difference.

//predictive coding

小结:

0-预测式、前瞻式、个性化压缩。

发问:

0-编码,字符串替换,abc-MAP-a?

Image Formats的更多相关文章

  1. 【原创】开源Math.NET基础数学类库使用(05)C#解析Delimited Formats数据格式

                   本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新  开源Math.NET基础数学类库使用总目录:[目录]开源Math.NET基础数学类库使用总目录 前言 ...

  2. Cannot load supported formats: Cannot run program "svn": CreateProcess error=2

    svn CreateProcess error=2, 系统找不到指定的文件 IntelliJ IDEA 13.1.2安装后,SVN checkout时候会出现如下错误: Cannot load sup ...

  3. [BTS] Correct the specified Action, or refer to the documentation on the allowed formats for the Actions

    A message sent to adapter "WCF-SAP" on send port "CNILG.iHouse.SAP.WCFSAP" with ...

  4. (转)Aspone.Cells设置Cell数据格式 Setting Display Formats of Numbers and Dates

    Setting Display Formats Using Microsoft Excel: Right-click on any desired cell and select Format Cel ...

  5. 17.1.2 Replication Formats

    17.1.2 Replication Formats 复制格式 17.1.2.1 Advantages and Disadvantages of Statement-Based and Row-Bas ...

  6. 17.1.2?Replication Formats 复制格式:

    17.1.2?Replication Formats 复制格式: 17.1.2.1 Advantages and Disadvantages of Statement-Based and Row-Ba ...

  7. 14.9.4 COMPACT and REDUNDANT Row Formats

    14.9.4 COMPACT and REDUNDANT Row Formats InnoDB 早期的版本 使用一种未命名的文件格式(现在称为Antelope(羚羊)) 对于数据库文件 在这种文件格式 ...

  8. 14.9 InnoDB Row Storage and Row Formats InnoDB 行存储和行格式:

    14.9 InnoDB Row Storage and Row Formats InnoDB 行存储和行格式: 14.9.1 Overview of InnoDB Row Storage 14.9.2 ...

  9. 14.8.1 Enabling File Formats

    14.8 InnoDB File-Format Management 14.8.1 Enabling File Formats 14.8.2 Verifying File Format Compati ...

随机推荐

  1. 学会使用Chromium中的LOG

    转自:http://blog.csdn.net/kuerjinjin/article/details/43937345 简介 众所周知chromium项目无比巨大,想去快速的了解,调试并添加自己想要的 ...

  2. 对学长所谓“改变世界的游戏”《shield star》的运行感想-毛宇部分(完整版本请参考团队博客)

    对于学长项目<shield star>的思考和看法: Ryan Mao ((毛宇)  110616-11061171 试用了一下学长黄杨等人开发的<shield star>游戏 ...

  3. 使用AIDL远程调用服务中的方法

    AIDL:android interface define language(接口定义语言) 作用:方便远程调用其他服务中的方法 注意:安卓四大组件都要在清单文件注册 aidl创建图: AIDL的全称 ...

  4. Spotlight on MySQL监控MySQL服务器

    第一步: 下载并安装mysql-connector-3.5x Spotlight on MySQL 连接mysql必须使用mysql-connector-3.5x,5.3.2版本我试了下不行,有兴趣可 ...

  5. Spring AOP 详解

    AOP使用场景 AOP用来封装横切关注点,具体可以在下面的场景中使用: Authentication 权限 Caching 缓存 Context passing 内容传递 Error handling ...

  6. SU Demos-02Filtering-02Subfilt

    巴特沃斯滤波器的特点是通频带的频率响应曲线最平滑.这种滤波器最先由英国工程师斯替芬·巴特沃斯(Stephen Butterworth)在1930年发表在英国<无线电工程>期刊的一篇论文中提 ...

  7. 移动开单软件 手持PDA开单扫描打印系统开发介绍

    具体功能预览--(图示) PDA开单打印扫描采集器主程序: ▲门店使用:接单员销售开单.销售退货或查询相关资料. ▲仓库使用:PDA仓库验收货.发货.仓库盘点 ▲在外业务开单:业务在外面开销售单.销售 ...

  8. 状压DP SGU 223 Little Kings

    题目传送门 /* 题意:n*n的矩阵,放置k个king,要求king互相不能攻击,即一个king的8个方向都没有另外的king,求方案个数 状态压缩DP:dp[i][num[j]][s] 代表在第i行 ...

  9. POJ1699 Best Sequence(AC自动机+状压DP)

    题目,求包含所有的给定的n个DNA片段的序列的最短长度. AC自动机上的DP题. dp[S][u]表示已经包含的DNA片段集合为S,且当前后缀状态是自动机第u个结点的最短长度 dp[0][0]=0 我 ...

  10. BZOJ3563 : DZY Loves Chinese

    想法题,由于K是加密的,但是通过读入我们可以自己数出来这一行有几个数, 所以可以直接反解出之前回答为连通的个数 至于最后一个询问就用并查集暴力回答 var n,i,m,s,k,j,q : longin ...