Investigating Google's WebP image format.
Google's WebP image format provides superior compression and quality characteristics compared to its older JPEG and PNG counterparts.
You can convert images to use the WebP format via the cwebp
CLI tool provided as part of the libwebp
codec. Simply download the appropriate libwebp
version for your machine from the repository, then add the bin
directory to your PATH
so the cwebp
tool is accessible via your terminal.
See Google's Getting Started docs for more information.
Generate Lossy Image (default)
$ cwebp {original-image} -o {new-image}.webp
Generate Lossless Image
$ cwebp -lossless {original-image} -o {new-image}.webp
Although we currently do not have cross-browser support for WebP, Google has provided a number of fallback options for us to use.
Type | Result | Size |
---|---|---|
Original | 240kb | |
Compressed - lossy | 40kb | |
Compressed - lossless | 173kb |