WebP


WebP is an image format employing both lossy and lossless compression. It is currently developed by Google, based on technology 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 license.
The format was first announced on 30 September in 2010 as a new open standard for lossy compressed true-color graphics on the web, producing smaller files of comparable image quality to the older JPEG scheme.
On 3 October 2011, Google added an "Extended File Format" allowing WebP support for animation, ICC profile, XMP and Exif metadata, and tiling.
The support for animation allowed for converting older animated GIF to animated WebP.
On 18 November 2011, Google began to experiment with lossless compression and support for transparency in both lossless and lossy modes; support has been enabled by default in libwebp 0.2.0. According to Google's measurements, a conversion from PNG to WebP results 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.
The WebP container allows feature support over and above the basic use case of WebP. The WebP container provides additional support for:
In a comparison made between GIF, APNG and WebP, it was shown, however, that APNG kept lower file size while keeping at least equal quality.

Technology

WebP's lossy compression algorithm is based on the intra-frame coding of the VP8 video format and the Resource Interchange File Format 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. 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 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. There are four basic modes of block prediction: horizontal, vertical, DC, 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 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.
WebP's lossless compression, a new 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. 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.

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. 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.

Support

Web browsers

, Firefox, Opera, GNOME Web, Midori, and Falkon natively support WebP.
EdgeHTML based versions of Microsoft Edge support WebP through a platform extension. 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. Since versions of Microsoft Edge released after January 2020 are based on the Chromium browser, WebP support is built-in without the need of platform extensions.
Safari is adding support for WebP in version 14, to be released with iOS 14 and macOS Big Sur.
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.

[Graphics software]

,
PhotoLine, Pixelmator, ImageMagick, XnView, IrfanView, GDAL, Aseprite, Paint.NET, GIMP and gThumb all natively support WebP. In 2019, Google released a free plug-in that enables WebP support in Adobe Photoshop. Before that, free Photoshop plug-ins were released by Telegraphics and fnordware. Imagine supports WebP via a plugin. 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.

Other programs

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 Picasa Web Albums 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. 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.
In early beta versions of macOS Sierra and iOS 10, Apple added WebP support, but was later removed GM seed versions of iOS 10 and macOS Sierra released 7 September 2016. WebP is unsupported in macOS and iOS Safari browser version 13 or lower. However, support is being added in Safari version 14.
Content management systems 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 format, which may cause color loss on images with thin contrast elements and ghosting in anaglyph. To overcome this restriction, new lossless WebP supports VP8L encoding that works exclusively with 8-bit ARGB color space.

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.
However WebP is not included in the .

Criticism

In September 2010, Fiona Glaser, a developer of the x264 encoder, wrote a very early critique of WebP. Comparing different encodings 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", 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 WebP outperformed JPEG by any significant margin.

Metadata

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