WebP is an image format employing both lossy[6] and lossless compression, along with animation and alpha transparency. Developed by Google, it is designed to create smaller or better looking images compared to the JPEG, PNG, or GIF image formats.

The WebP format was announced in September 2010, and the supporting library reached version 1.0 in April 2018. Support for the format has increased over the years, and as of February 2021 WebP was supported by 92% of the web browsers in use worldwide.[7]

History

WebP was first announced by Google on 30 September in 2010 as a new open format for lossy compressed true-color graphics on the web, producing smaller files of comparable image quality to the older JPEG scheme.[8] It was based on technology that Google acquired with the purchase of On2 Technologies.[9] As a derivative of the VP8 video format, it is a sister project to the WebM multimedia container format.[10] WebP-related software is released under a BSD free software license.[11]

On 3 October 2011,[12] Google added an "Extended File Format"[13] allowing WebP support for animation, ICC profile, XMP and Exif metadata, and tiling (compositing very large images from maximum 16384×16384 tiles). The support for animation allows for converting older animated GIF to animated WebP.

On 18 November 2011, Google announced a new lossless compression mode, and support for transparency (alpha channel) in both lossless and lossy modes; support was enabled by default in libwebp 0.2.0 (16 August 2012).[14][15] According to Google's measurements in November 2011, a conversion from PNG to WebP resulted in a 45% reduction in file size when starting with PNGs found on the web, and a 28% reduction compared to PNGs that are recompressed with pngcrush and PNGOUT.[16]

In July 2016, Apple added WebP support to early beta versions of macOS Sierra and iOS 10,[17] but support was later removed in the GM seed versions of iOS 10 and macOS Sierra released in September 2016. In September 2020, WebP support was added in Safari version 14.[18]

The supporting libwebp library reached version 1.0 in April 2018.[19]

As of February 2021, WebP was supported by 92% of the web browsers in use worldwide.[7]

Technology

Simple WebP
Bytes Content
 0- 3 R I F F
 4- 7 length+8
 8-11 W E B P
12-15 V P 8 [20]
16-19 length (padded)
20- … VP8 key frame
pad (even length)

WebP's lossy compression algorithm is based on the intra-frame coding of the VP8 video format[21] and the Resource Interchange File Format (RIFF) as a container format.[2] As such, it is a block-based transformation scheme with eight bits of color depth and a luminance-chrominance model with chroma subsampling by a ratio of 1:2 (YCbCr 4:2:0).[22] Without further content, the mandatory RIFF container has an overhead of only twenty bytes, though it can also hold additional metadata.[2] The side length of WebP images is limited to 16,383 pixels.[4]

WebP is based on block prediction. Each block is predicted on the values from the three blocks above it and from one block to the left of it (block decoding is done in raster-scan order: left to right and top to bottom). There are four basic modes of block prediction: horizontal, vertical, DC (one color), and TrueMotion. Mispredicted data and non-predicted blocks are compressed in a 4×4 pixel sub-block with a discrete cosine transform or a Walsh–Hadamard transform. Both transforms are done with fixed-point arithmetic to avoid rounding errors. The output is compressed with entropy encoding.[22] WebP also has explicit support for parallel decoding.[22]

The reference implementation consists of converter software in the form of a command-line program for Linux (cwebp) and a programming library for the decoding, the same as for WebM. The open source community quickly managed to port the converter to other platforms, such as Windows.[23]

WebP's lossless compression, a newer format unrelated to VP8, was designed by Google software engineer Jyrki Alakuijala. It uses advanced techniques such as dedicated entropy codes for different color channels, exploiting 2D locality of backward reference distances and a color cache of recently used colors. This complements basic techniques such as dictionary coding, Huffman coding and color indexing transform.[14] This format uses recursive definition: all of the control images such as the local entropy code selection are encoded the same way as the whole image itself.[24]

The WebP container (i.e., RIFF container for WebP) allows feature support over and above the basic use case of WebP (i.e., a file containing a single image encoded as a VP8 key frame). The WebP container provides additional support for:

  • Lossless compression – An image can be losslessly compressed, using the WebP Lossless Format.
  • Metadata – An image may have metadata stored in Exif or XMP formats.
  • Transparency – An image may have transparency, i.e., an alpha channel.
  • Color Profile – An image may have an embedded ICC profile as described by the International Color Consortium.
  • Animation – An image may have multiple frames with pauses between them, making it an animation.[25]

Animation

Google has proposed using WebP for animated images as an alternative to the popular GIF format, citing the advantages of 24-bit color with transparency, combining frames with lossy and lossless compression in the same animation, and as well as support for seeking to specific frames.[26] Google reports a 64% reduction in file size for images converted from animated GIFs to lossy WebP, and a 19% reduction when converted to lossless WebP.[26]

Support

Web browsers

Google Chrome and all Chromium-based browsers, Firefox[27] (and its forks Pale Moon[28] and Waterfox[29]), GNOME Web, Midori, and Falkon natively support WebP.

Microsoft Edge versions released after January 2020 are based on the Chromium browser, and have native WebP support. EdgeHTML based versions of Microsoft Edge support WebP through a platform extension (installed by default). EdgeHTML based versions of Microsoft Edge do not support platform extensions, including the WebP image format extension, when running in the security hardened "Application Guard" mode.[30]

Safari added support for WebP with iOS 14 and macOS Big Sur.[18]

WebP can also be displayed in all major browsers using the WebPJS JavaScript library, although support in Internet Explorer 6 and above is achieved using Flash.[31]

Graphics software

Picasa (from version 3.9),[32] PhotoLine,[33] Pixelmator,[34] ImageMagick,[35] XnView,[36] IrfanView,[37] GDAL,[38] Aseprite,[39] Paint.NET (from version 4.2.5),[40] GIMP (from version 2.10)[41] and gThumb (since September 2012)[42] all natively support WebP. In 2019, Google released a free plug-in that enables WebP support in Adobe Photoshop.[43] Before that, free Photoshop plug-ins were released by Telegraphics and fnordware.[44][45] Imagine[46] supports WebP via a plugin. GIMP up to version 2.8 also supported WebP via a plugin;[47] later, this plugin was shipped in GIMP 2.9 branch, and received multiple improvements.[48] Google has also released a plug-in for Microsoft Windows [49] that enables WebP support in Windows Photo Viewer, Microsoft Office 2010, FastPictureViewer,[50] and any other application that uses Windows Imaging Component.[51]

Other programs

FFmpeg linked with the VP8/VP9 reference codec library libvpx can extract VP8 key frames from WebM media and a script can then add the WebP RIFF header and the NUL pad byte for odd frame lengths. Meanwhile, FFmpeg supports libwebp directly.

Gmail and Google Photos both support WebP. Support for WebP is also planned for Google App Engine. The Instant Previews feature of Google Search uses WebP internally to reduce disk space used by previews.[52] Android 4.0 supports encoding and decoding WebP images (via bitmap and Skia).[53] SDL_image supports the format since 1.2.11.

Telegram Messenger uses WebP for their Stickers, claiming they are displayed 5 times faster compared to the other formats usually used in messaging apps.[54]

WebP is unsupported in macOS and iOS Safari browser version 13 or lower.[55] Support was added in Safari version 14.[18]

Content management systems (CMS) usually do not support WebP natively or by default. However, for most popular CMS, extensions are available for automated conversion from other image formats to WebP and delivering WebP images to compatible browsers.

Restrictions

Like VP8 on which it is based, former lossy WebP only supports 8-bit YUV 4:2:0 format,[56] which may cause color loss on images with thin contrast elements (such as in pixel art and computer graphics) and ghosting in anaglyph. To overcome this restriction, new lossless WebP supports VP8L encoding that works exclusively with 8-bit RGBA (red, green, blue, alpha) color space.[57][58]

Promotion

Google actively promotes WebP. The proprietary PageSpeed Insights tool suggests that webmasters switch from JPEG and PNG to WebP in order to improve their website speed score.[59] However, WebP is not included in the Google Merchant Feed specification for images.[60]

Criticism

In September 2010, Fiona Glaser, a developer of the x264 encoder, wrote a very early critique of WebP.[21] Comparing different encodings (JPEG, x264, and WebP) of a reference image, she stated that the quality of the WebP-encoded result was the worst of the three, mostly because of blurriness on the image. Her main remark was that "libvpx, a much more powerful encoder than ffmpeg's jpeg encoder, loses because it tries too hard to optimize for PSNR" (peak signal-to-noise ratio), arguing instead that "good psycho-visual optimizations are more important than anything else for compression."[21]

In October 2013, Josh Aas from Mozilla Research published a comprehensive study of current lossy encoding techniques[61] and was not able to conclude WebP outperformed mozjpeg by any significant margin.[62]

In a comparison made between GIF, APNG and WebP, it was shown that from GIF sources, APNG had a lower file size while keeping at least equal quality.[63]

Metadata

Although WebP supports storing Exif, XMP or ITPC metadata as RIFF container chunks as part of the Extended File Format,[64] Google provides no tools for major platforms such as Windows, macOS, Android, or iOS to edit and view metadata in WebP image files, but provides tools to migrate existing metadata in JPEG files to WebP.[65]

WebP 2

WebP 2 is a newer generation of WebP currently under development by Google. Its reference implementation is libwebp2. The main goal of this new format is to reach similar compression ratios as AVIF while remaining faster to encode and decode.[66]

See also

  • AVIF, an image format based on the AV1 video codec[67]
  • BPG, an image format intended to be a more compression-efficient replacement for the JPEG image format, based on the intra-frame encoding of the High Efficiency Video Coding (HEVC) video compression standard, introduced in 2014
  • FLIF, a work-in-progress lossless image format which claims to outperform PNG, lossless WebP, lossless BPG and lossless JPEG2000 in terms of compression ratio, introduced in 2015
  • HEIF, another image format based on HEVC
  • JPEG 2000, an improvement intended to replace the older JPEG by the JPEG committee, introduced in 2000
  • JPEG XL, particularly optimised for responsive web environments, so that content renders well on a wide range of devices. Moreover, it includes several features that help transition from the legacy JPEG format
  • JPEG XR, an alternative to JPEG 2000 supporting HDR and wide gamut color spaces, introduced in 2009
  • JPEG-LS, an old but efficient lossless format
  • MNG and APNG, PNG-based animated image formats, supporting lossless 24-bit RGB color and 8-bit alpha channel

References

  1. ^ "WEBP file extension". DotWhat.net. Retrieved 1 October 2010.
  2. ^ a b c Rabbat, Richard (30 September 2010). "WebP, a new image format for the Web". Chromium Blog. Retrieved 1 October 2010.
  3. ^ "RIFF Container". Google Code. Retrieved 1 October 2010.
  4. ^ a b "WebP FAQs". Google Code. Retrieved 6 October 2010.
  5. ^ Zern, James (30 January 2021). "libwebp 1.2.0". Chromium. Retrieved 30 January 2021.
  6. ^ Calore, Michael (1 October 2010). "Meet WebP, Google's New Image Format". Wired. Retrieved 5 October 2010.
  7. ^ a b "Can I use... WebP image format". caniuse.com. 18 February 2021. Retrieved 18 February 2021.
  8. ^ "Comparative Study of WebP, JPEG and JPEG 2000". Google Code. Archived from the original on 4 October 2010. Retrieved 1 October 2010.
  9. ^ Shankland, Stephen (30 September 2010). "Google Offers JPEG Alternative for Faster Web - With WebP, Google hopes to drastically cut data-transfer barriers to Web browsing. But it's not easy to challenge JPEG's dominance". CNET News. CBS Interactive. Retrieved 18 February 2021.
  10. ^ Paul, Ryan (2 October 2010). "Google's New VP8-Based Image Format Could Replace JPEG". Ars Technica. Condé Nast. Retrieved 5 October 2010.
  11. ^ Rabbat, Richard (3 October 2010). "License/Patent clarification". Google Groups. Retrieved 11 March 2011.
  12. ^ Arora, Vikas (3 October 2011). "WebP-Mux (RIFF based container) framework". Google Groups. Retrieved 18 November 2011.
  13. ^ "WebP Container Specification". Google Developers. Retrieved 4 April 2020.
  14. ^ a b Alakuijala, Jyrki (30 August 2012). "Lossless and Transparency Modes in WebP". Google Developers Blog. Retrieved 6 September 2012.
  15. ^ Zern, James (16 August 2012). "Version 0.2.0". Chromium. Retrieved 6 January 2017.
  16. ^ Alakuijala, Jyrki; Arora, Vikas; Joshi, Urvang (18 November 2011). "Lossless and Transparency Encoding in WebP". Google Code Blog. Retrieved 18 November 2011.
  17. ^ Stephen Shankland (19 July 2016). "Apple tests Google graphics format to speed up websites". CNET. Retrieved 20 July 2016.
  18. ^ a b c "Apple Developer Documentation - Safari 14 Release Notes". developer.apple.com. Retrieved 18 February 2021.
  19. ^ "libwebp 1.0.0 release". 21 April 2018. Retrieved 18 February 2021.
  20. ^ WebP Container Specification: U+0020 for lossy images, and "L" for lossless images.
  21. ^ a b c Glaser, Fiona (30 September 2010). "H.264 and VP8 for still image coding: WebP?". Diary Of An x264 Developer. Archived from the original on 19 March 2015. Retrieved 1 October 2010.
  22. ^ a b c "VP8 Data Format and Decoding Guide" (PDF). 23 September 2010. Retrieved 2 October 2010.[permanent dead link]
  23. ^ "WebP for .NET". Codeplex. Microsoft. 1 October 2010.
  24. ^ Jyrki Alakuijala (16 September 2014). "WebP Lossless Bitstream Specification". Google.
  25. ^ "WebP Container Specification". Google Developers. Retrieved 4 April 2020. CC-BY icon.svg Text was copied from this source, which is available under a Creative Commons Attribution 4.0 International License.
  26. ^ a b "Frequently Asked Questions". 21 February 2014. Retrieved 23 February 2014.
  27. ^ "Firefox 65 Release Note".
  28. ^ Moonchild. "Pale Moon – Release Notes for Archived Versions". www.palemoon.org. Retrieved 19 November 2018.
  29. ^ Kontos, Alex. "Waterfox 54.0.1 Release (Windows, Mac & Linux)". Waterfox 54.0.1 Release (Windows, Mac & Linux). Retrieved 19 November 2018.
  30. ^ "WebP images won't load in Microsoft Edge with Application Guard". Retrieved 14 November 2018.
  31. ^ "WebPJS – Google's new image format WebP for not supported browsers (with alpha-channel)". Retrieved 20 November 2011.
  32. ^ Picasa and Picasa Web Albums Release Notes
  33. ^ "Release notes Version 18.00". pl32.com. Retrieved 5 October 2013.
  34. ^ David, Chartier (4 October 2010). "Pixelmator to Add Support for Google's WebP Image Format". PC World. IDG. Retrieved 5 October 2010.
  35. ^ "ImageMagick Image Formats". ImageMagick.org. ImageMagick Studio LLC. Retrieved 24 May 2011.
  36. ^ "XnView Software – All Supported Formats". xnview.com. Pierre-Emmanuel Gougelet. Retrieved 6 January 2014.
  37. ^ History of IrfanView changes
  38. ^ "GDAL supported formats". gdal.org. GDAL – Geospatial Data Abstraction Library. Retrieved 30 November 2011.
  39. ^ "Aseprite – Release-notes". www.aseprite.org. Retrieved 28 March 2016.
  40. ^ "paint.net 4.2.5 is now available!". blog.getpaint.net. Retrieved 1 October 2019.
  41. ^ "GIMP 2.10 Release Notes". www.gimp.org. Retrieved 2 May 2018.
  42. ^ "[gthumb-list] gThumb 3.1.1 released". Retrieved 2 May 2020.
  43. ^ "WebPShop". Photoshop plug-in for opening and saving WebP images. Google. Retrieved 15 July 2019.
  44. ^ "WebP Format". Free plugins for Photoshop & Illustrator. Telegraphics. Retrieved 23 May 2011.
  45. ^ "Adobe WebM/WebP plugins". fnordware.com. Retrieved 29 June 2015.
  46. ^ Sejin Chun. "Imagine: Freeware Image & Animation Viewer for Windows". Retrieved 2 May 2018.
  47. ^ "nathan-osman/gimp-webp: Gimp plugin for loading and saving WebP images". Retrieved 30 March 2016.
  48. ^ "GIMP 2.9.6 Released". www.gimp.org. Retrieved 24 May 2018.
  49. ^ WebP Codec Installer for Windows 0.19
  50. ^ FastPictureViewer Image Formats Compatibility
  51. ^ "WebP Codec for Windows". WebP website. Google Code. Archived from the original on 5 May 2012. Retrieved 24 May 2011.
  52. ^ "The Chromium Blog: WebP in Chrome, Picasa, Gmail With a Slew of New Features and Improvements". 21 May 2011. Retrieved 20 May 2011.
  53. ^ Android 4.0 Platform Highlights
  54. ^ "Stickers Done Right"
  55. ^ "Can I Use WebP image format".
  56. ^ Google (November 2011). "Format Overview". VP8 Data Format and Decoding Guide. IETF. sec. 2. doi:10.17487/RFC6386. RFC 6386. Retrieved 21 January 2014.
  57. ^ "Frequently Asked Questions".
  58. ^ "WebP Lossless Bitstream Specification".
  59. ^ "Serve Images in Next-Gen Formats".
  60. ^ Google Merchant Feed specification for images
  61. ^ Josh Aas. "Studying Lossy Image Compression Efficiency". Mozilla Research Blog. Retrieved 10 September 2014.
  62. ^ Josh Aas. "Mozilla Advances JPEG Encoding with mozjpeg 2.0". Mozilla Research Blog. Retrieved 10 September 2014.
  63. ^ "GIF vs APNG vs WebP". littlesvr. Retrieved 2 April 2019.
  64. ^ WebP Container Specification
  65. ^ "cwebp | WebP". Google Developers. Retrieved 8 December 2020.
  66. ^ codecs/libwebp2
  67. ^ "AV1 Still Image File Format (AVIF)". aomediacodec.github.io. Retrieved 10 October 2018.

External links