For faster navigation, this Iframe is preloading the Wikiwand page for WebP.

WebP

WebP
扩展名
.webp[1]
互联网媒体类型
image/webp
首次发布2010年9月30日 (2010-09-30)[2]
最新版本
1.4.0[3]在维基数据编辑
2024年4月13日
使用容器資源交換檔案格式(RIFF)[4]
免费格式?[5]
网站developers.google.com/speed/webp/

WebP(發音:weppy[6][7])是一種同時提供了有損壓縮無損壓縮(可逆壓縮)的圖片檔案格式[8]

WebP最初在2010年9月釋出,其支持库于2018年4月发布1.0版本。截至2021年5月,已有94%的浏览器支持此格式[9]

WebP的设计目標是在減少檔案大小的同时,達到和JPEGPNGGIF格式相同的圖片品質,并希望借此能夠減少圖片檔在網路上的傳送時間。[10]根據Google較早的測試,WebP的無損壓縮比網路上找到的PNG檔少了45%的檔案大小,即使這些PNG檔在使用pngcrush和PNGOUT處理過,WebP還是可以減少28%的檔案大小[11]

WebP支援的像素最大數量是16383x16383。有損壓縮的WebP僅支援8-bit的YUV 4:2:0格式。而無損壓縮(可逆壓縮)的WebP支援VP8L編碼與8-bit之RGBA色彩空間。而無論是有損或無損壓縮皆支援Alpha透明通道、ICC色彩配置、XMP詮釋資料。

WebP有靜態與動態兩種模式。動態WebP(Animated WebP)支援有損與無損壓縮、ICC色彩配置、XMP詮釋資料、Alpha透明通道。

历史

[编辑]

Google于2010年9月30日首次公布WebP格式,它衍生自影像編碼格式VP8[12],被認為是WebM多媒體格式的姊妹項目,是Google在購買On2 Technologies後获得技术發展而来的[13],该格式及其衍生的支持库以BSD授權條款釋出。[14]

2011年10月3日,Google给WebP添加了扩展格式以让其支持ICC色彩特性文件可扩展后设资料平台EXIF[15]

2011年11月8日,Google開始讓WebP支援無損壓縮和透明色(alpha通道)的功能,而在2012年8月16日的參考實做libwebp 0.2.0中正式支援[16][17]

截至2024年8月,已有96.45%的浏览器支持此格式[18]

技術

[编辑]
简单WebP
内容
 0- 3 R I F F
 4- 7 length+8
 8-11 W E B P
12-15 V P 8 [15]
16-19 length (padded)
20- … VP8关键帧
pad (even length)

WebP的有损压缩算法是基于VP8视频格式的帧内编码英语Intra-frame coding[19],并以RIFF作为容器格式[2] 因此,它是一个具有八位色彩深度和以1:2的比例进行色度子采样亮度-色度模型YCbCr 4:2:0)的基于块的转换方案。[20] 不含内容的情况下,RIFF容器要求只需20字节的开销,依然能保存额外的元数据(metadata)。[2] WebP图像的边长限制为16383像素。[5]

WebP是基于块预测的。每个块都是根据它上面三个块的值和其左边一个块的值进行预测的(块解码以光栅扫描顺序完成:从左到右,从上到下)。块预测有四种基本模式:水平、垂直、DC(单色)和TrueMotion。利用离散余弦变换沃尔什-阿达玛转换将预测错误的数据和未预测块压缩在4×4像素子块中。这两种转换都是使用定点算术英语fixed-point arithmetic完成的,以避免舍入误差。输出使用熵编码进行压缩。[20] WebP也明确支持并行解码。[20]

参考实现包含一个Linux命令行程序的转换器,以及用于解码的,与WebM相同。开源社区很快设法将转换器移植到其他平台,例如Windows。[21]

WebP的无损压缩采用先进的技术,例如用于不同颜色通道的专用熵代码,利用反向参考距离的2D位置和最近使用的颜色的颜色缓存。这补充了字典编码、霍夫曼编码和颜色索引变换等基本技术。[17]

支援

[编辑]

浏览器

[编辑]

Chrome和所有基于Chromium的浏览器(如OperaBrave等)均原生支援靜態與動態的WebP格式[22][23],且自12版開始支援WebP的漸進式解碼功能[24]

从2020年1月后发布的基于Chromium的Edge版本原生支持WebP格式。在此之前基于EdgeHTML的Edge版本则在除安全应用保护模式外,通过默认安装的平台扩展实现支持[25]

Firefox和所有延伸自Firefox的浏览器(如Pale MoonWaterfox等)瀏覽器亦在65.0版本起支援WebP圖像。[26]

2020年9月,在iOS 14macOS Big SurSafari 14中加入了WebP支持。[27]

Linux中使用的GNOME WebKDE圖片瀏覽器Gwenview也支援WebP。

此外所有可以原生播放WebM影像的瀏覽器,也可以透過javascript來顯示WebP影像[28][29]。不过在Internet Explorer 6和以上版本中是通过Flash实现的。

图像软件

[编辑]

圖像軟體當中,Picasa(從3.9版本起)、PhotoLine英语PhotoLine[30]Pixelmator[31]ImageMagickXnViewIrfanViewGDAL[32]、Aseprite和GIMP(2.10起)皆原生支援WebP格式。

系统

[编辑]

Android 4.0 支持解码和编码 WebP 图像(通过位图和 Skia 引擎)。[33]

其他程序

[编辑]

FFmpeg 在链接 VP8/VP9 参考代码库 libvpx 的情况下可以从 WebM 视频提取 VP8 关键帧,并有脚本追加 WebP RIFF 标头,并对怪异的帧长度追加 NUL 填充字节。同时 FFmpeg 也支持直接使用 libwebp。

Gmail 和 Google 相册都支持 WebP。

Sumatra PDF 从2.4版开始支持 WebP。[34]

Telegram 将 WebP 用于他们的表情符號,声称它们的显示速度比消息应用程序中通常使用的其他格式快5倍[35]

Signal 在非动态图片贴纸中使用 WebP 格式。[36]

LibreOffice 从7.4版本开始支持导入及导出 WebP 图像,[37]采用同样技术的 Collabora Online 也获得这一格式的支持。

Godot 引擎 4.0 版支持导入及导出 WebP 图像,并使用 WebP 作为编排已导入的压缩纹饰图像的内部格式。[38]

評論

[编辑]

x264的開發者之一:Jason Garrett-Glaser,在2010年時針對WebP做出了幾點評論[39],根據和其他編碼器(JPEG、x264、Theora)測試的結果,他認為WebP的影像品質是最差的,多數是在模糊度方面。他也評論Google應該等到WebP可以超越JPEG之後再發佈。不過在2011年4月20日,他提到新的WebP編碼器表現的非常好,超越JPEG指日可待。

WebP 2

[编辑]

WebP 2是Google自2021年6月起开发的新一代WebP。它的具体实现为libwebp2。这种新格式的主要目标是达到与AV1类似的压缩比,并同时保有更快的编码和解码速度[40]

相關條目

[编辑]

參考文獻

[编辑]
  1. ^ WEBP file extension. DotWhat.net. [2010-10-01]. (原始内容存档于2013-03-13). 
  2. ^ 2.0 2.1 2.2 Rabbat, Richard. WebP, a new image format for the Web. Chromium Blog. Google. 2010-09-30 [2010-10-01]. (原始内容存档于2011-08-13). 
  3. ^ libwebp-1.4.0. 
  4. ^ RIFF Container. Google Code. Google. [2010-10-01]. (原始内容存档于2013-03-13). 
  5. ^ 5.0 5.1 WebP FAQs. Google Code. Google. [2010-10-06]. (原始内容存档于2013-03-13). 
  6. ^ WebP Home页面存档备份,存于互联网档案馆): "Did you know? WebP is pronounced 'weppy'. /(wĕpˈē)/"
  7. ^ Chapman, Stephen. Google's New WebP Image Standard Is All About SEO. ZDNet. 2010-10-04 [2010-10-06]. (原始内容存档于2010-10-07). 
  8. ^ Calore, Michael. Meet WebP, Google's New Image Format. Wired. 2010-10-01 [2010-10-05]. (原始内容存档于2011-09-25). 
  9. ^ WebP image format | Can I use... Support tables for HTML5, CSS3, etc. caniuse.com. [2021-07-18]. (原始内容存档于2021-07-23). 
  10. ^ Comparative Study of WebP, JPEG and JPEG 2000. Google Code. Google. [2010-10-01]. (原始内容存档于2010-10-04). 
  11. ^ Google Code blog: Lossless and transparency encoding in WebP. [2013-08-21]. (原始内容存档于2011-11-20). 
  12. ^ Paul, Ryan. Google's new VP8-based image format could replace JPEG. Ars Technica. 2010-10-02 [2010-10-05]. (原始内容存档于2011-07-31). 
  13. ^ Shankland, Stephen. Google offers JPEG alternative for faster Web. CNET News. CBS Interactive. 2010-09-30 [2010-10-01]. (原始内容存档于2011-04-03). 
  14. ^ Rabbat, Richard. License/Patent clarification. 2010-10-03 [2011-03-11]. (原始内容存档于2013-06-20). 
  15. ^ 15.0 15.1 WebP Container Specification页面存档备份,存于互联网档案馆): U+0020 for lossy images, and "L" for lossless images.
  16. ^ WebP v0.2.0 decoder and encoder source tree. [2013-08-21]. (原始内容存档于2013-07-01). 
  17. ^ 17.0 17.1 Google Developers Blog: Lossless and Transparency Modes in WebP. [2013-08-21]. (原始内容存档于2016-03-03). 
  18. ^ WebP image format | Can I use... Support tables for HTML5, CSS3, etc. caniuse.com. [2022-01-29]. (原始内容存档于2021-07-23). 
  19. ^ Glaser, Fiona. H.264 and VP8 for still image coding: WebP?. Diary Of An x264 Developer. 2010-09-30 [2010-10-01]. (原始内容存档于2015-03-19). 
  20. ^ 20.0 20.1 20.2 VP8 Data Format and Decoding Guide (PDF). Google. 2010-09-23 [2010-10-02]. [永久失效連結]
  21. ^ WebP for .NET. Codeplex. Microsoft. 2010-10-01 [2018-03-02]. (原始内容存档于2018-01-16). 
  22. ^ Metz, Cade. Google open sources JPEG assassin. The Register (San Francisco). 2010-09-30 [2010-10-03]. (原始内容存档于2019-11-04). 
  23. ^ Ødegaard, Ruarí. CSS gradients, WebP, and Declarative UI. Opera Desktop Team (Opera Software ASA). My Opera. 2011-03-15 [2011-03-15]. (原始内容存档于2011-03-17). 
  24. ^ The Chromium Blog: WebP in Chrome, Picasa, Gmail With a Slew of New Features and Improvements. Google. 2011-05-21 [2011-05-20]. (原始内容存档于2011-08-06). 
  25. ^ Aleksandersen, Daniel. WebP images won’t load in Microsoft Edge with Application Guard. www.ctrl.blog. 2018-11-14 [2021-07-18]. (原始内容存档于2021-07-28) (英语). 
  26. ^ Firefox 65 Release Note. [2019-01-29]. (原始内容存档于2021-12-15). 
  27. ^ Apple Developer Documentation - Safari 14 Release Notes. developer.apple.com. [2021-05-13]. (原始内容存档于2021-05-14). 
  28. ^ Weppy Demo: WebP in modern browsers today. GitHub. [2010-10-11]. (原始内容存档于2011-08-11). 
  29. ^ Weppy: Javascript Shim for WebP on Chrome 6 and Firefox 4.0. Blog: this title probably isn't very original. antimatter15.com. 2010-10-03 [2011-05-24]. (原始内容存档于2011-01-13). 
  30. ^ Release notes Version 18.00. pl32.com. [2013-10-05]. (原始内容存档于2021-05-13). 
  31. ^ David, Chartier. Pixelmator to Add Support for Google's WebP Image Format. PC World. IDG. 2010-10-04 [2010-10-05]. [失效連結]
  32. ^ GDAL supported formats. gdal.org. GDAL - Geospatial Data Abstraction Library. [2011-11-30]. (原始内容存档于2016-01-12). 
  33. ^ Android 4.0 Platform Highlights. [2023-09-16]. (原始内容存档于2011-11-11). 
  34. ^ version history. SumatraPDF documentation. [2023-09-16]. (原始内容存档于2021-06-02). 
  35. ^ Stickers Done Right. Telegram. 2015-01-02 [2022-01-29]. (原始内容存档于2022-04-29). 
  36. ^ Stickers – Signal Support. [2023-09-16]. (原始内容存档于2023-04-19). 
  37. ^ LibreOffice 7.4 Community: Release Notes - the Document Foundation Wiki. [2023-09-16]. (原始内容存档于2022-08-24). 
  38. ^ Add support for saving WebP images #61770. GitHub. 21 June 2022-06-21 [2023-09-16]. (原始内容存档于2023-02-28). 
  39. ^ Garrett-Glaser, Jason. H.264 and VP8 for still image coding: WebP?. Diary Of An x264 Developer. 2010-09-30 [2010-10-01]. (原始内容存档于2010-11-27). 
  40. ^ codecs/libwebp2 - Git at Google. chromium.googlesource.com. [2021-07-18]. (原始内容存档于2021-03-25). 

外部連結

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
WebP
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?