WebP: What is it and why should I use it?

webp: what is it and why should i use it?
Contents hide
What’s the compression like?
Is there quality loss?
Which browsers support it?
How can I provide backwards compatibility?
How can I test the difference?
Will I see it as an option in my photo editing software?
Ok, so how do I use it on my website?
What if my hosting doesn’t support WebP yet?
Conclusion

With one of the oddest and shortest names for a new technology in a while, WebP is a new image format which was originally developed by Google. The reason for this format is to improve the efficiency of the image compression in order to greatly reduce the size of the images.

This of course means less bandwidth to load a website and therefore faster websites, which is one of the key goals Google wants all web developers to deliver. Anyone who’s trying to ensure they have the best SEO optimisation for their site should therefore be looking at WebP as a high priority!

Incorporating both lossy (JPEG and similar) and lossless (PNG and similar) formats, WebP is a universal format and has differing compression algorithms to optimise for both styles of images.

Official Site: A new image format for the Web | WebP

What’s the compression like?

To show a “real world” example, I’ve used an image by Erik McLean on Unsplash. This image is a JPEG image, which looks like the following:

webp: what is it and why should i use it?

The original image was 3.6MB. Now of course many of these images aren’t in a web friendly resolution to start with (it’s 5472 x 3648 pixels) but it’ll at least form the baseline for our comparison.

To first show what it can compress down to as a JPEG still but without any quality loss, I’ve used my favourite tool JPEGmini. For anyone who takes a lot of photos, this is a must have when it comes to reducing the size of your originals but retaining all of the quality. Using JPEGmini, we’ve reduced the size to 2.7MB or roughly a 25% saving. This is pretty good, and on higher resolution images I’ve found the results are as high as 50%.

Now to webP. I’ve used an online conversion tool ( convertio.co) as the conversion tool as it’s just for a once-off image conversion. This has reduced the image size now down to 1.5MB or a nearly 60% reduction!

Not all images will have such a dramatic decrease in size, however Google are stating that on average they see a 25-35% reduction which is still a considerable improvement.

Is there quality loss?

There are two types of image compression schemes, lossless (meaning no loss in quality) and lossy. Images like JPEG are already lossy formats, meaning that they reduce the size of the file by trying to “combine” pixels of similar colours rather than storing them individually. 

This is a large oversimplification of the way it works, but essentially the greater the compression then the greater the quality loss. 

I cropped a section of the images to compare where there was a reasonable amount of detail and combined before saving in a lossless (PNG) format.

webp: what is it and why should i use it?

Note

As our website includes automatic optimisation and image compression, the comparison may not display correctly for you. However, we encourage you to do your own comparisons!

It was very difficult to find any difference between the three personally, which is a good thing! 

Which browsers support it?

Of course, for the images to be displayed, web browsers firstly need to support the image format. The good news is that all major browsers except one support WebP:

webp: what is it and why should i use it?
Source: https://caniuse.com/#feat=webp (May 2020)

Sadly, Apple has been very late to the party in providing WebP support while Google Chrome added support back in 2012. This means that while Apple drags their feet for political reasons (it’s not a technical limitation), you’ll need to provide backwards compatibility for Apple users.

Update: Apple finally added support in late 2020 for Safari on iOS and macOS with Safari 14, however this requires your macOS and iOS versions to be updated for it to work.

How can I provide backwards compatibility?

While Apple and some old corporate and/or government departments who are forced to use IE 11 will be the only ones affected by using WebP, thankfully the HTML img tag allows you to add backwards compatibility. Let’s take a look at the following example code:

<img alt=”This is a webP image” src=”/wp-content/uploads/2020/05/testimage.webp” />

The src attribute tells the browser where to find the file, with the alt attribute simply to provide a non-visual descriptor of the image. In order to provide backwards compatibility, we can change this to a <picture> tag, which would look similar to the following:

<picture>
    <source srcset="/wp-content/uploads/2020/05/testimage.webp" type="image/webp">
    <source srcset="/wp-content/uploads/2020/05/testimage.jpg" type="image/jpeg">
    <img alt=”This is a webP image” src=”/wp-content/uploads/2020/05/testimage.jpg” />
</picture>

The <picture> tag allows for multiple <source> tags to be added, allowing the browser to detect what it supports and fallback to a standard JPEG or PNG file as required.

Of course, this adds significant complexities if you’re hand coding your site but also why using a plugin for your site will be the quickest route (with suggestions below!).

How can I test the difference?

To determine how much space you’ll save on your site, you can use Google Pagespeed Insights to test and measure the difference. For instance, I’ve used the SBS website (simply chosen as it was recently opened) as a test and you simply need to observe the Serve images in next-gen formats section:

webp: what is it and why should i use it?

You can click to expand to see what difference this makes to individual images on your site:

webp: what is it and why should i use it?

Google also gives an estimation in time based on the reduced download size, but this time will vary of course depending on the overall Internet connection.

Will I see it as an option in my photo editing software?

While the format and size improvements are great, it’s still very much a “new” technology when it comes to traditional photo editing systems. Plugins like WebPShop provide the ability to export images from Photoshop but for now most photo editors have poor to no support.

At some point in the future, we hope to see more systems using WebP out of the box so that more than just websites can take advantage of the space saving. For now, we suggest keeping originals in JPEG or PNG format and using WebP for your website only. 

Ok, so how do I use it on my website?

In the latest Plesk Obsidian 18.0.27 release, all PHP versions now use the latest GD image library so that all of the Conetix Web Hosting systems (and others of course) now provide support to generate these images.  

For websites running WordPress, this means plugins like WebP Converter for Media and WebP Express and many others can generate these images directly from your website and automatically optimise your site. 

Of course, we very highly recommend that you take a backup first before proceeding, but all good plugins create a new WebP image while leaving the original image untouched. Here’s one quick example of the optimisations for a test site using WebP Express: 

webp: what is it and why should i use it?

We’d then recommend testing your site both with your own browser to ensure there’s no anomalies but also using Google Pagespeed Insights so that you have a before and after comparison.

What if my hosting doesn’t support WebP yet?

First of all, ask your hosting provider if they do support it and if not, when they will. If they’re a Plesk based hosting provider then they’ll either have it on their plans to roll out soon or if you can be moved to a server which already supports it. At Conetix, we’ve already rolled out support to all of our web hosting plans and progressively rolling the update out to managed servers as well.

If there’s no support then you still have two options. The first option is to use an external platform to optimise the images. Some plugins provide this as a free option for a limited number of images whereas others it’s a small monthly fee to access their cloud based optimisation. There’s also third party services such as Cloudflare, which can automatically optimise the images for you on their paid plans.

The second option is of course to move providers. While this is a drastic option for many, you may find a better provider who offers things like the latest PHP versions a better fit for your business if you’re chasing better customer experiences. What’s more, the better hosting providers also provide free migration so that there’s no additional cost and no downtime involved.

Conclusion

With all browsers except one and with a fallback option, now is the time to convert your website to use WebP. By having the image libraries on your web server directly support WebP means you can run the conversions for free as well.

This fallback works well enough that you probably didn’t notice nearly all images on the Conetix site are WebP based and therefore worked without issue.

Even with a modest 30% reduction in image size (you may see 60% or more!), this can represent a significant gain for users on less than optimal connections such as mobile users.

Back to the Blog

avatar of tim butler

Tim Butler

With over 20 years experience in IT, I have worked with systems scaling to tens of thousands of simultaneous users. My current role involves providing highly available, high performance web and infrastructure solutions for small businesses through to government departments. NGINX Cookbook author.

  • Conetix
  • Conetix

Let's Get Started

  • This field is for validation purposes and should be left unchanged.

深圳SEO优化公司保定优化黔南网站定制报价昭通SEO按天计费多少钱延安英文网站建设报价厦门网站关键词优化哪家好海南网站建设设计报价安阳阿里店铺托管多少钱喀什seo网站推广价格西安网站建设哪家好西安模板制作多少钱海口百度竞价平顶山关键词排名包年推广多少钱安康阿里店铺托管公司铁岭百度爱采购公司南山网站优化按天收费哪家好资阳企业网站建设报价韶关模板推广公司襄阳网站搜索优化推荐柳州设计网站价格昌吉百度竞价价格海南网站优化哪家好聊城seo优化推荐南阳网站建设价格玉溪seo优化公司开封网页设计价格宝鸡关键词排名包年推广推荐娄底SEO按效果付费多少钱武威企业网站设计公司渭南百搜标王推荐平湖英文网站建设哪家好歼20紧急升空逼退外机英媒称团队夜以继日筹划王妃复出草木蔓发 春山在望成都发生巨响 当地回应60岁老人炒菠菜未焯水致肾病恶化男子涉嫌走私被判11年却一天牢没坐劳斯莱斯右转逼停直行车网传落水者说“没让你救”系谣言广东通报13岁男孩性侵女童不予立案贵州小伙回应在美国卖三蹦子火了淀粉肠小王子日销售额涨超10倍有个姐真把千机伞做出来了近3万元金手镯仅含足金十克呼北高速交通事故已致14人死亡杨洋拄拐现身医院国产伟哥去年销售近13亿男子给前妻转账 现任妻子起诉要回新基金只募集到26元还是员工自购男孩疑遭霸凌 家长讨说法被踢出群充个话费竟沦为间接洗钱工具新的一天从800个哈欠开始单亲妈妈陷入热恋 14岁儿子报警#春分立蛋大挑战#中国投资客涌入日本东京买房两大学生合买彩票中奖一人不认账新加坡主帅:唯一目标击败中国队月嫂回应掌掴婴儿是在赶虫子19岁小伙救下5人后溺亡 多方发声清明节放假3天调休1天张家界的山上“长”满了韩国人?开封王婆为何火了主播靠辱骂母亲走红被批捕封号代拍被何赛飞拿着魔杖追着打阿根廷将发行1万与2万面值的纸币库克现身上海为江西彩礼“减负”的“试婚人”因自嘲式简历走红的教授更新简介殡仪馆花卉高于市场价3倍还重复用网友称在豆瓣酱里吃出老鼠头315晚会后胖东来又人满为患了网友建议重庆地铁不准乘客携带菜筐特朗普谈“凯特王妃P图照”罗斯否认插足凯特王妃婚姻青海通报栏杆断裂小学生跌落住进ICU恒大被罚41.75亿到底怎么缴湖南一县政协主席疑涉刑案被控制茶百道就改标签日期致歉王树国3次鞠躬告别西交大师生张立群任西安交通大学校长杨倩无缘巴黎奥运

深圳SEO优化公司 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化