What is WebP WebP image and how to use in WordPress

The image is often one of the biggest reasons for the slow page loads. They not only slow down the loading time, but also take up a lot of space and resources on the server. Carefully select the file type and compression help reduce their load faster, but they can only be optimized before the image quality is impaired. Another option is to use one type of image file optimization: from Google's WebP .

What is WebP

Google WebP is designed specifically for network raster image format. It provides a lossless and lossy compression that allows web designers to display richer image in a smaller file size.

WebP lossy image coding using the prediction to encode the image. It predicted value to reduce the file size, then only the difference is coded by viewing the adjacent pixels. Lossy JPEG images than comparable image smaller by 34%.

WebP lossless image using the reconstructed image segments have seen a new pixel. If no match is found, you can use a local palette. Lossless image 26% smaller than the same PNG image. Lossless WebP support alpha channel (transparency), 3 times smaller file size than a comparable image of PNG.

What is WebP file

WebP file using VP8 or VP8L image data, and based on RIFF container. It uses the file extension .webp. The libwebp   library is implemented as a reference WebP specification. You can see the library git repository or as a tarball.

 

How will it change your web design practice

The main advantage of WebP is a small file, so pages load faster, use fewer resources from your server. This also means that if visitors use a browser that supports them, you will be able to use a larger image more colors, without increasing the server's current load.

You do not have to deal very seriously images using a smaller area in the layout. You can use applicable to the design of size, speed, or rather because the page load time for the design of smaller images.

How to use WebP image in WordPress

  • The Google+
  • Facebook's
  • Twitter

ChromeP and Opera browsers, and many image editing tools itself support WebP. You may still have security concerns WordPress. There are several ways you can use WebP together with WordPress. You can convert the file, but the best option is to use plug-ins.

WebP conversion plug

One of the best ways WebP image as designers or developers is that you do not need to create a file of work. Instead, you only need to install the conversion plug-ins. You will upload JPEG or PNG common image format, the files will be converted to a plug-in WebP, in order to transmit the image to visitors.

The advantage of this method is that you only need to deal with file types have become accustomed to, but can not use WebP visitors will still receive the original file type. Those who can receive WebP file types will see faster load times.

Another approach is to allow you to upload WebP files to your website. This method is not recommended, because not all browsers support this format. This means that some of your visitors will not be able to view your pictures.

There are several free and advanced add-ons can convert images to WebP. Here are some free options.

EWWW image optimizer

  • The Google+
  • Facebook's
  • Twitter

EWWW Image Optimizer is a free plug-in with WebP conversion function. It generates WebP version of JPEG and PNG. It contains a number of options, such as Apache compatible rewrite rules, as well as alternative WebP rewriting options. It is compatible with caching and CDN, and the Cache Enabler plug KeyCDN used in conjunction.

This is probably the easiest to use. Built-in functions allow you to use WebP lossy JPEG conversion and PNG lossless conversion, and the conversion is automatic. You have to do is install the plugin and enable WebP tab. No additional setup required.

Short optimizer pixel image

  • The Google+
  • Facebook's
  • Twitter

ShortPixel Image Optimizer is a free plug-in, you can convert any JPEG, PNG or GIF as WebP. It uses lossy and lossless compression. It also applies to support WebP caching plugins. It provides WebP images can view them in the browser, available in alternative formats for those who can not see their browser.

它还可以选择使用HTML将WebP图像添加到前端页面中。为此,您可以使用<picture>标记而不是普通的<img>标记。要将其设置为自动转换图像,只需在“高级”选项卡中启用该功能即可。您可以根据需要恢复图像。

WebP Express

  • Google+的
  • Facebook的
  • 推特

WebP Express是一个免费的插件,可以生成不到JPEG大小一半的图像。它将JPEG和PNG路由到要转换的图像转换器或已转换的图像。无论图像如何到达服务器,它都能正常工作。它适用于媒体库,库和CSS引用的主题图像。

它不适用于Microsoft IIS服务器或WAMP,并且尚未使用多站点进行测试。它确实需要一些转换方法的设置,但你有几个可供选择。图像将首先使用顶部的转换方法,如果该图像失败,它将沿着列表向下工作,直到找到适用于图像的方法。您可以按照希望它们使用它们的顺序拖动它们。

Opti MozJpeg Guetzli WebP

  • Google+的
  • Facebook的
  • 推特

Opti MozJpeg Guetzli WebP是一个免费的插件,它是在考虑Google Pagespeed Insights的情况下创建的。它使用Mozilla MozJpeg,Google Guetzli和Google WebP图像编码器来转换图像。编码器可以在本地安装,也可以使用内置的ssh客户端。它使用与作者虚拟机的ssh连接远程访问编码器。

它可以将所有非alpha通道PNG转换为JPEG。它会在进行更改之前备份您的图像。您可以随时还原图像。

WebP示例

对于我的例子,我想展示一些质量和尺寸差异。我将各种格式和质量级别的相同图像保存起来进行比较。我实际上是在我的图像编辑器中显示图像的屏幕截图。我正在使用带有WebP插件的Paint.NET。当我将这些图像上传到这个网站时,这些图像的尺寸会减小一些,所以它们看起来可能会比实际上看起来有点不同,但希望它们能提供一个很好的比较。

  • Google+的
  • Facebook的
  • 推特

This is a picture I took from Unsplash. This is a JPEG file, down to 800 pixels wide, save 98% by mass. This is a 237kb file.

  • The Google+
  • Facebook's
  • Twitter

This is the same image saved as a PNG. This is a 1.09mb file.

  • The Google+
  • Facebook's
  • Twitter

This is the same image saved as the WebP. It also holds 98% of the mass. This is a 199kb file.

  • The Google+
  • Facebook's
  • Twitter

This is the same WebP files saved 34%. This is a 35kb file. Difficult to see any difference between the images.

Written in the last

That's what we look at what is and what is WebP WebP files. This format greatly reduces the size of image files, saves a lot of space and shortens the loading time. The main drawback is that it only with a small number of browser compatibility. Fortunately, you can use a plug-in to convert the current library into WebP, so that those using a compatible browser plug-in also provides services to the WebP format can not view common file types.

WebP is an interesting format. Because it comes from Google and I hope it will eventually catch on. It has always existed since 2010, so it is slowly developing. Save the file size and loading speed makes the use of plug-ins can be used to convert an image to visitors that they are worth it. This is a free speed

Do you use or plan to use WebP image in web design? Please tell us what you think in the comments WebP.

Original link: https://jhrs.com/2019/31253.html

Guess you like

Origin www.cnblogs.com/jessory/p/11238260.html