ArticleslgStudy

computer science

WebP

WebP is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand WebP rather than just read about it. In short: WebP is a raster graphics file format developed by Google and intended as a replacement for the JPEG, PNG, and GIF file formats on the web. It supports image compression (both lossy and lossless), as well as animation and alpha compositing.

WebP — main illustration
WebP — illustration

Key takeaways

  • WebP belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect WebP to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of WebP from memory before moving on to harder problems.

Reference excerpt

WebP is a raster graphics file format developed by Google and intended as a replacement for the JPEG, PNG, and GIF file formats on the web. It supports image compression (both lossy and lossless), as well as animation and alpha compositing. The sister project for video is called WebM. Google announced the WebP format in September 2010; the company released the first stable version of its supporting library in April 2018. WebP has seen widespread adoption across the Internet in order to reduce image size, with all major browsers currently supporting the format.

History WebP was first announced by Google on 30 September 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. The pronunciation as given by the developers is "weppy" (). 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. 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. In November 2024, WebP was formally specified in and published as RFC 9649.

Technology

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 16383 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:

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.

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

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 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 for lossless WebP.

Support

Web browsers As of 2024, web browsers that support WebP had 96.09% market share.

… excerpt ends here. Continue reading the full article.

Illustrations

WebP illustration
WebP illustration

Worked examples

Example 1 — a first encounter with WebP

Start with the simplest possible case. Write down what WebP claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to WebP before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about WebP ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of WebP

In research
WebP appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses WebP in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
WebP is common in secondary-school and first-year university syllabi. It links to neighbouring topics Animated graphics file formats, Computer-related introductions in 2010, Google, so understanding it makes those chapters shorter.
In everyday life
Look for WebP outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “WebP” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study WebP in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what WebP means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain WebP out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is WebP in simple terms?

WebP is a raster graphics file format developed by Google and intended as a replacement for the JPEG, PNG, and GIF file formats on the web. It supports image compression (both lossy and lossless), as well as animation and alpha compositing.

Why does WebP matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study WebP?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on WebP.

Tags

  • Animated graphics file formats
  • Computer-related introductions in 2010
  • Google
  • Image compression
  • Open formats
  • Raster graphics file formats

Keep exploring