How to load images faster in your website

Junaid S. Shaikh
2 min readJun 18, 2020

--

Image is a very important aspect of a website. Because nobody likes ‘slow-loading’ web pages on the internet. One of the techniques to improve your website’s performance is to use optimized images.

WebP image format

What is the WEBP image format?

WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters, and web developers can create smaller, richer images that make the web faster.

WebP lossless images are 26% less in size compared to PNGs. WebP lossy images are 25–34% less than comparable JPEG images at the equivalent SSIM quality index. Lossless WebP supports transparency (also known as alpha channel) at a cost of just 22% additional bytes. For cases when lossy RGB compression is acceptable, lossy WebP also supports transparency, typically providing smaller file sizes compared to PNG.

How does it work?

Lossy WebP compression does predictive coding to encode an image, the same method used by the VP8 video codec to compress keyframes in videos. Predictive coding uses the values in neighboring blocks of pixels to predict the values in a block and then encodes only the difference.

Lossless WebP compression uses already seen image fragments in order to exactly reconstruct new pixels. It can also use a local palette if no interesting match is found.

WebP Support

WebP is natively supported in Google Chrome, Firefox, Edge, the Opera browser, and many other tools and software libraries. Developers have also added support to a variety of image editing tools.

WebP includes the lightweight encoding and decoding library libwebp and the command line tools cwebp and dwebp for converting images to and from the WebP format, as well as tools for viewing, and animating WebP images.

How to convert images into WebP?

You can convert images from PNG and JPEG to WebP by downloading the precompiled cwebp conversion tool for Linux, Windows, or Mac OS X.

Visit: https://developers.google.com/speed/webp/download

--

--

Junaid S. Shaikh
Junaid S. Shaikh

Written by Junaid S. Shaikh

I am a passionate software developer, blogger, writer, and entrepreneur.

No responses yet