A new image format for the Web

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

A new image format for the Web

WebP is a new image format that provides lossless and lossy compression forimages on the web. WebP lossless images are 26% smaller in size comparedto PNGs. WebP lossy images are 25-34% smaller in size compared to JPEGimages at equivalent SSIM index. WebP supports lossless transparency (alsoknown as alpha channel) with just 22% additional bytes. Transparency isalso supported with lossy compression and typically provides 3x smaller filesizes compared to PNG when lossy compression is acceptable for thered/green/blue color channels.

Webmasters and web developers can use the WebP image format to create smallerand richer images that can help make the web faster.

How WebP Works

Lossy WebP compression uses predictive coding to encode an image, the samemethodology used by the VP8 video codec to compress keyframes in videos.Predictive coding uses the values in neighboring blocks of pixels to predictthe values in a block, and then encodes only the difference (residual) betweenthe actual values and the prediction.

The residuals typically contain many zero values, which can be compressed muchmore effectively. The residuals are then transformed, quantized and entropy-coded as usual. WebP also uses variable block sizes.

Lossless WebP compression uses already seen image fragments in order toexactly reconstruct new pixels. It can also use a local palette if nointeresting match is found. This palette is continuously updated to re-userecent colors. This compression mode is named "VP8L" and shares some commonfeatures with the so-called LZ77 compression algorithm.

A WebP file consists of VP8 or VP8L image data, and a containerbased on RIFF. The standalone libwebp library serves as a referenceimplementation for the WebP specification, and is available fromour git repository and as a tarball.

WebP Support

WebP is natively supported in Google Chrome and the Opera browser, and bymany other tools and software libraries.

Developers have also added support to a variety of image editing tools. Thisrelease also provides the lightweight encoding and decoding librarylibwebp and the command line tools cwebp and dwebp forconverting images to and from the WebP format. The full source code isavailable on the download page.

WebP Converter Download

Convert your favorite collection from PNG and JPEG to WebP by downloading theprecompiled cwebp conversion tool for Linux, Windows or Mac OS X.

Tell us your experience on the project's mailing list.

条款   |   隐私权
<img height="1" width="1" src="//www.googleadservices.com/pagead/conversion/992540712/?label=qio2CKCPwQMQqPCj2QM&amp;guid=ON&amp;script=0" _xhe_src="//www.googleadservices.com/pagead/conversion/992540712/?label=qio2CKCPwQMQqPCj2QM&amp;guid=ON&amp;script=0"/>

在Cesium加载WMS服务时,`format:image/svg` 和 `format:image/svg+xml` 本质上都用于表示SVG(可缩放矢量图形)格式的图像,但在具体使用和含义上存在一些区别。 ### 媒体类型的精确性 - `image/svg+xml` 是SVG图像的标准媒体类型(MIME类型)。它明确遵循XML语法规则,是W3C推荐用于在网络上传输SVG图像的正式类型。使用这个类型可以确保浏览器和其他客户端能够准确识别并正确处理SVG文件,因为它严格遵循了SVG作为XML文档的规范。 - `image/svg` 并不是标准的MIME类型。在一些旧的系统或不严格遵循标准的环境中可能会使用它,但它缺乏 `image/svg+xml` 的精确性和规范性。在现代的Web开发和网络传输中,建议使用标准的 `image/svg+xml` 类型以保证兼容性和一致性。 ### 兼容性 - `image/svg+xml` 被广泛支持,几乎所有现代的浏览器和图像查看器都能正确识别和渲染以 `image/svg+xml` 类型传输的SVG图像。在Cesium加载WMS服务时,使用该类型能确保在各种环境下都能正常显示SVG格式的地图图层。 - `image/svg` 由于不是标准类型,在某些较新的或严格遵循标准的客户端中可能会遇到兼容性问题。一些浏览器或应用程序可能无法正确识别该类型,从而导致图像无法正常加载或显示。 ### 代码示例 以下是在Cesium中使用 `image/svg+xml` 格式加载WMS服务的示例代码: ```javascript var viewer = new Cesium.Viewer('cesiumContainer'); var wmsImageryProvider = new Cesium.WebMapServiceImageryProvider({ url: 'https://example.com/wms', layers: 'layerName', parameters: { service: 'WMS', format: 'image/svg+xml', transparent: true } }); viewer.imageryLayers.addImageryProvider(wmsImageryProvider); ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值