WebP is a raster graphics file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency.
|Internet media type||image/webp|
|Uniform Type Identifier (UTI)||org.webmproject.webp|
|Magic number||52 49 46 46 xx xx xx xx 57 45 42 50 56 50 38|
|Initial release||30 September 2010|
|Type of format||Image file format with lossless and lossy compression|
|Contained by||Resource Interchange File Format (RIFF)|
1.3.2 / 14 September 2023
Google announced the WebP format in September 2010, and released the first stable version of its supporting library in April 2018.
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 files that were smaller than JPEG files for comparable image quality. It was based on technology which Google had acquired with the purchase of On2 Technologies. As a derivative of the VP8 video format, it is a sister project to the WebM multimedia container format. WebP-related software is released under a BSD free software license.
On 3 October 2011, Google added an "Extended File Format" allowing WebP support for animation, ICC profile, XMP and Exif metadata, and tiling (compositing very large images from maximum 16384×16384 tiles). Tiling support was never finalized and was removed from the spec again. Older animated GIF files can be converted 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). 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.
In July 2016, Apple added WebP support to early beta versions of macOS Sierra and iOS 10, 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.
The supporting libwebp library reached version 1.0 in April 2018.
As of November 2021, web browsers that support WebP had 96% market share.
|4–7||length + 12|
|20–…||VP8 key frame|
|pad||? (even length)|
WebP's lossy compression algorithm is based on the intra-frame coding of the VP8 video format and the Resource Interchange File Format (RIFF) as a container format. 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). Without further content, the mandatory RIFF container has an overhead of only twenty bytes, though it can also hold additional metadata. The side length of WebP images is limited to 16384 pixels.
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. WebP also has explicit support for parallel decoding.
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 ported the converter to other platforms, such as Windows.
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:
- An image may have metadata stored in Exif or XMP formats.
- 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.
Lossless compression edit
WebP's lossless compression, a newer algorithm 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. This format uses a recursive definition: all of the control images, such as the local entropy code selection, are encoded the same way as the whole image itself.
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 support for seeking to specific frames. Google reports a 64% reduction in file size for images converted from animated GIFs to lossy WebP, however, with a very noticeable visual impact, both at default settings, and optimised settings. When converting using lossless WebP, a 19% reduction is achieved as reported by Google, although real world performance is nearer to 10%.
Web browsers edit
Google actively promotes WebP, and Google Chrome and all Chromium-based browsers support the format. The proprietary PageSpeed Insights tool suggests that webmasters switch from JPEG and PNG to WebP in order to improve their website speed score.
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) (unless running in the security-hardened "Application Guard" mode, which does not support platform extensions).
Graphics software edit
Acorn (from version 7.0), Picasa (from version 3.9), PhotoLine, Pixelmator, ImageMagick, XnView, IrfanView, GDAL, Aseprite, Paint.NET (from version 4.2.5), GIMP (from version 2.10), gThumb (from version 3.1.1), Xara Designer Pro (from version 18.0), Adobe Photoshop (from version 23.2) and GraphicConverter all natively support WebP.
In 2019, Google released a free plug-in that enables WebP support in earlier versions of Adobe Photoshop. Free Photoshop plug-ins had been released by Telegraphics and fnordware before that. GIMP up to version 2.8 also supported WebP via a plugin; later, this plugin was shipped in GIMP 2.9 branch, and received multiple improvements. Google has also released a plug-in for Microsoft Windows that enables WebP support in Windows Photo Viewer, Microsoft Office 2010, FastPictureViewer, and any other application that uses Windows Imaging Component. Blender supports WebP since version 3.2.
Other programs edit
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. Android 4.0 supports encoding and decoding WebP images (via bitmap and Skia). SDL_image supports the format since 1.2.11.
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. Since June 2021, WordPress supports WebP natively.
Like VP8 on which it is based, former lossy WebP supports only 8-bit YUV 4:2:0 format, 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.
However, due to the complexity of the compression, it is also significantly slower than other web image formats. It is therefore usually not advisable to process the images directly, as is the case with Web Map Services.
In September 2010, Fiona Glaser, a developer of the x264 encoder, wrote a very early critique of WebP. 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".
In October 2013, Josh Aas from Mozilla Research published a comprehensive study of current lossy encoding techniques and was not able to conclude that WebP outperformed mozjpeg by any significant margin.
This section's factual accuracy may be compromised due to out-of-date information. The reason given is: CVE-2023-4863 has been patched tempestively in libwebp 1.3.2 and should no longer be exploitable. (December 2023)
In September 2023, two critical vulnerabilities relating to WebP images were discovered by Apple Security Engineering and Architecture (SEAR) and the Citizen Lab, potentially affecting Google Chrome, Chromium-based browsers and the Google's libwebp project, among any application implementing libwebp. Among these vulnerabilities, CVE-2023-4863 was an actively exploited vulnerability with a high risk rating of CVSS 8.8. This could lead to an out of bounds/overflow condition in applications using the affected libwebp library, upon exploitation of a maliciously crafted .webp lossless file. This could result in a denial of service (DoS), or worse, enabling malicious remote code execution (RCE). The extensive use of libwebp packages across hundreds of applications, including all categories from web browsers to mobile apps, posed a major patching challenge to mitigate the vulnerability due to the demanding testing requirements before release, highlighting the implications of this vulnerability on a wide scale.
WebP 2 edit
Google has been developing the second version of WebP since June 2021. 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.
On October 12, 2022, Google changed WebP 2's development repository's README file to state that "WebP 2 will not be released as an image format" and began describing WebP 2 as a "playground for image compression experiments".
See also edit
- Comparison of graphics file formats
- AVIF, an image format based on the AV1 video format
- 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 discontinued lossless image format which claimed to outperform PNG, lossless WebP, lossless BPG and lossless JPEG2000 in terms of compression ratio, introduced in 2015. FLIF was superseded by JPEG XL.
- HEIF, another image format based on HEVC.
- From the Joint Photographic Experts Group:
- JPEG-LS, an old but efficient lossless format, introduced in 1999.
- JPEG 2000, an improvement intended to replace the older JPEG by the JPEG committee, introduced in 2000.
- JPEG XR, an alternative to JPEG 2000 supporting HDR and wide gamut color spaces, introduced in 2009.
- 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 XL was introduced at the end of 2020.
- MNG and APNG, PNG-based animated image formats, supporting lossless 24-bit RGB color and 8-bit alpha channel.
- "WEBP file extension". DotWhat.net. Retrieved 1 October 2010.
- WebP Image Format Media Type Registration. IETF. I-D draft-zern-webp. Retrieved 7 July 2022.
- "webP". Apple Developer Documentation: Uniform Type Identifiers. Apple Inc.
- Rabbat, Richard (30 September 2010). "WebP, a new image format for the Web". Chromium Blog. Retrieved 1 October 2010.
- "RIFF Container". Google Code. Retrieved 1 October 2010.
- "WebP FAQs". Google Code. Retrieved 6 October 2010.
- Zern, James (14 September 2023). "libwebp 1.3.2". Chromium. Retrieved 15 September 2023.
- Calore, Michael (1 October 2010). "Meet WebP, Google's New Image Format". Wired. Retrieved 5 October 2010.
- "Comparative Study of WebP, JPEG and JPEG 2000". Google Code. Archived from the original on 4 October 2010. Retrieved 1 October 2010.
- 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.
- Paul, Ryan (2 October 2010). "Google's New VP8-Based Image Format Could Replace JPEG". Ars Technica. Condé Nast. Retrieved 5 October 2010.
- Rabbat, Richard (3 October 2010). "License/Patent clarification". Google Groups. Retrieved 11 March 2011.
- Arora, Vikas (3 October 2011). "WebP-Mux (RIFF based container) framework". Google Groups. Retrieved 18 November 2011.
- "WebP Container Specification". Google Developers. Retrieved 4 April 2020.
- Zern, James (22 December 2014). "webp-container-spec: remove references to fragments". Retrieved 6 May 2023.
- Alakuijala, Jyrki (30 August 2012). "Lossless and Transparency Modes in WebP". Google Developers Blog. Retrieved 6 September 2012.
- Zern, James (16 August 2012). "Version 0.2.0". Chromium. Retrieved 6 January 2017.
- Alakuijala, Jyrki; Arora, Vikas; Joshi, Urvang (18 November 2011). "Lossless and Transparency Encoding in WebP". Google Code Blog. Retrieved 18 November 2011.
- Stephen Shankland (19 July 2016). "Apple tests Google graphics format to speed up websites". CNET. Retrieved 20 July 2016.
- "Apple Developer Documentation - Safari 14 Release Notes". developer.apple.com. Retrieved 18 February 2021.
- "libwebp 1.0.0 release". 21 April 2018. Retrieved 18 February 2021.
- "Can I use... WebP image format". caniuse.com. Retrieved 19 November 2021.
- "WebP Container Specification: U+0020 for lossy images, and "L" for lossless images".
- 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.
- "VP8 Data Format and Decoding Guide" (PDF). 23 September 2010. Retrieved 2 October 2010.[permanent dead link]
- "WebP for .NET". Codeplex. Microsoft. 1 October 2010. Archived from the original on 15 September 2021. Retrieved 5 May 2022.
- Jyrki Alakuijala (16 September 2014). "WebP Lossless Bitstream Specification". Google Inc.
- "Frequently Asked Questions". 21 February 2014. Retrieved 23 February 2014.
- "GIF is (Finally) dead. Long live Webp". technedigitale.com. 24 July 2021. Retrieved 19 August 2021.
- "Serve images in modern formats". Chrome Developers.
- "WebP images won't load in Microsoft Edge with Application Guard". 14 November 2018. Retrieved 14 November 2018.
- "Firefox 65 for developers - Mozilla | MDN". developer.mozilla.org. 24 August 2023.
- Kontos, Alex. "Waterfox 54.0.1 Release (Windows, Mac & Linux)". Retrieved 19 November 2018.
- "Firefox 65 supports Google's WebP Image format - gHacks Tech News". gHacks Technology News. 2 November 2018. Retrieved 20 January 2022.
- Shankland, Stephen. "Why Mozilla had a change of heart about WebP images". CNET. Retrieved 20 January 2022.
- Moonchild. "Pale Moon – Release Notes for Archived Versions". www.palemoon.org. Retrieved 19 November 2018.
- "WebPJS – Google's new image format WebP for not supported browsers (with alpha-channel)". Retrieved 20 November 2011.
- "Changelog". Retrieved 14 May 2022.
- Mueller, Gus. "Acorn". Flying Meat Software. Retrieved 15 December 2022.
- "What's happening to Picasa, Picasa Web Albums, and the Picasa Web Albums API? - Picasa and Picasa Web Albums Help". support.google.com.
- "Release notes Version 18.00". pl32.com. Retrieved 5 October 2013.
- David, Chartier (4 October 2010). "Pixelmator to Add Support for Google's WebP Image Format". PC World. IDG. Retrieved 5 October 2010.
- "ImageMagick Image Formats". ImageMagick.org. ImageMagick Studio LLC. Retrieved 24 May 2011.
- "XnView Software – All Supported Formats". xnview.com. Pierre-Emmanuel Gougelet. Retrieved 6 January 2014.
- "History of IrfanView changes/versions". www.irfanview.com.
- "GDAL supported formats". gdal.org. GDAL – Geospatial Data Abstraction Library. Retrieved 30 November 2011.
- "Aseprite – Release-notes". www.aseprite.org. Retrieved 28 March 2016.
- "paint.net 4.2.5 is now available!". blog.getpaint.net. October 2019. Retrieved 1 October 2019.
- "GIMP 2.10 Release Notes". www.gimp.org. Retrieved 2 May 2018.
- "[gthumb-list] gThumb 3.1.1 released". Retrieved 2 May 2020.
- "Release notes Version 18". Xara website. Retrieved 9 September 2021.
- "Work with WebP files in Photoshop".
- "Lemke Software: Import and export formats". www.lemkesoft.de.
- "WebPShop". Photoshop plug-in for opening and saving WebP images. Google Inc. Retrieved 15 July 2019.
- "WebP Format". Free plugins for Photoshop & Illustrator. Telegraphics. Retrieved 23 May 2011.
- "Adobe WebM/WebP plugins". fnordware.com. Retrieved 29 June 2015.
- "nathan-osman/gimp-webp: Gimp plugin for loading and saving WebP images". GitHub. Retrieved 30 March 2016.
- "GIMP 2.9.6 Released". www.gimp.org. 24 August 2017. Retrieved 24 May 2018.
- "WebP Codec Installer for Windows 0.19".
- "FastPictureViewer Professional | Image File Formats Compatibility Chart". www.fastpictureviewer.com.
- "WebP Codec for Windows". WebP website. Google Inc. Archived from the original on 5 May 2012. Retrieved 24 May 2011.
- "Pipeline, Assets, IO". Retrieved 20 June 2022.
- "The Chromium Blog: WebP in Chrome, Picasa, Gmail With a Slew of New Features and Improvements". 21 May 2011. Retrieved 20 May 2011.
- "Android 4.0 Platform Highlights".
- "version history". SumatraPDF documentation. Retrieved 16 September 2023.
- "Stickers Done Right". Telegram. 2 January 2015.
- "Stickers – Signal Support".
- "LibreOffice 7.4 Community: Release Notes - the Document Foundation Wiki".
- "Add support for saving WebP images #61770". GitHub. 21 June 2022.
- "WordPress 5.8 adds WebP support". 7 June 2021.
- "Format Overview". VP8 Data Format and Decoding Guide. IETF. November 2011. sec. 2. doi:10.17487/RFC6386. RFC 6386. Retrieved 21 January 2014.
- "Frequently Asked Questions | WebP". Google Developers.
- "Specification for WebP Lossless Bitstream". Google Developers.
- "WebP Discussion Group: Compression time and file size". 16 February 2023. Retrieved 17 February 2023.
- Josh Aas (17 October 2013). "Studying Lossy Image Compression Efficiency". Mozilla Research Blog. Retrieved 10 September 2014.
- Josh Aas (15 July 2014). "Mozilla Advances JPEG Encoding with mozjpeg 2.0". Mozilla Research Blog. Retrieved 10 September 2014.
- Goodin, Dan (21 September 2023). "Incomplete disclosures by Apple and Google create "huge blindspot" for 0-day hunters". Ars Technica. Retrieved 29 September 2023.
- "codecs/libwebp2 - Git at Google". chromium.googlesource.com. 8 June 2021. Retrieved 16 June 2021. Updated from time to time.
- Guyon, Yannis. "Diff - 1251ca748c17278961c0d0059b744595b35a4943". Google Git. Google LLC. Retrieved 30 October 2022.
- "AV1 Still Image File Format (AVIF)". aomediacodec.github.io. Retrieved 10 October 2018.