Performance) and look for the results of the Serve images in next-genįormats audit. Run the Lighthouse Performance Audit ( Lighthouse > Options > Lighthouse can be used to verify that all images on your site are being served This will allow you to use image markup similar to the following with automatic WebP support: If a WebP alternate is found, it will be served with the proper Content-Type header. The rewrite rule above will look for a WebP version of any requested JPEG or PNG image. If you go this route, you'll need to set the HTTP Vary response header to ensure caches will understand that the image may be served with varying content types: Which level is the right tradeoff between image quality and filesize for yourĬonvert a single file, using cwebp's default compression settings: cwebp images/flower.jpg -o images/flower.webpĬonvert a single file, using a quality level of 50: cwebp -q 50 images/flower.jpg -o images/flower.webpĬonvert all files in a directory: for file in images/* do cwebp "$file" -o "$/$1.webp -f It's worth playing around with this, find When you convert images to WebP, you have the option to set a wide variety ofĬompression settings-but for most people the only thing you'll ever need toĬare about is the quality setting. Webpack or Gulp), whereas the CLI is a good choiceįor simple projects or if you'll only need to convert images once. The Imagemin WebP plugin is generally the best choice if your project uses build People generally use one of the following approaches for converting their images Lossy compression reduces file size, but at the expense of possibly WebP offers both lossless and lossy compression. WebP is an excellent replacement for JPEG, PNG, and GIF images. YouTube found that switching to WebP thumbnails resulted in 10%Ģ5-35% filesize savings for JPEGs and an 80% filesize savings for PNGs when.Magnitude of a 25–35% reduction in filesize. Google Chrome, Opera, Picasa, PhotoLine, Pixelmator, ImageMagick, XnView, IrfanView, GDALĪpple Safari, Google Chrome, Mozilla Firefox, Internet Explorer, Adobe Photoshop, Paint Shop Pro, the GIMP, ImageMagick, IrfanView, Pixel image editor, images are smaller than their JPEG and PNG counterparts-usually on the In addition, GIF images are compressed using the Lempel-Ziv-Welch (LZW) lossless data compression technique to reduce the file size without degrading the visual quality. GIF supports up to 8 bits per pixel for each image, allowing a single image to reference its palette of up to 256 different colors chosen from the 24-bit RGB color space. 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 support seeking specific frames. It has since come into widespread usage on the World Wide Web due to its wide support and portability. The Graphics Interchange Format (better known by its acronym GIF) is a bitmap image format introduced by CompuServe in 1987.
WebP-related software is released under a BSD license. As a derivative of the VP8 video format, it is a sister project to the WebM multimedia container format. WebP is an image format employing both lossy and lossless compression. Image format, Lossless/lossy compression algorithm GIF - CompuServe Graphics Interchange Format