WebP is a new Picture File format, launched by Google in 2010, which aims to reduce file size but achieve the same picture quality as JPEG format. In the traditional web pages based on JPEG or PNG image format, the loading of image resources often occupies the main part of the time-consuming page. Reducing the size of the image on the premise of ensuring the quality of the image is the main advantage of WebP format compared with other image formats.
Here are the pros and cons of the WebP image format and the improved user experience with WebP images.
WebP benefits
Take a picture as an example:
Compared to PNG format, WebP format has:
- It has a better image data compression algorithm, which can bring smaller image volume on the premise of image quality that can not be recognized by the naked eye;
- WebP supports Alpha transparency and 24-bit color number, and does not have the problem that PNG8 is not rich enough in color and has rough edges. The file size is reduced by 80% -90%
- compared with the equivalent PNG format, which improves the page loading speed, reduces the storage requirements, and helps accelerate the website graphics effect.
WebP disadvantage
WebP images take "8 times longer to encode than JPEG images". Therefore, under the same conditions, it takes more time to generate Raster Tile in WEBP format than in other formats.
WebP performance comparison
SuperMap desktop supports the generation of Raster Tile in WebP format, and is often used to generate 3D SceneCache, which greatly reduces the volume of data while ensuring the quality of data. At the same time, it is also widely used in mobile and Web terminals. Webpages used in browsers are in WebP format, which can improve the speed of loading and rendering, and compatibility is not considered. It can save user traffic and improve access speed.
In Order to know the performance of using WebP format as the result of Raster Tiles, the same map data is used to Generate Tiles in JPG _ PNG and WebP format respectively, the test environment is the same, and the storage type is original. The cutting range, cutting scale and Tile parameters are the same.
The test results are as follows:
- Comparison of time consumption: Under the same conditions, the time consumption of generating Raster Tile in WebP format is longer than that in JPG _ PNG format, which is 117.86% of the JPG _ PNG.
- File size comparison: Under the same conditions, the size of the raster cache file generated by the WebP format is smaller than that of the JPG _ PNG format, which is 67.24% of the JPG _ PNG.
- Reading test comparison: Under the same conditions, the same image in WebP format and JPG _ PNG format is 40% faster on average; when reading 1000 times, WebP takes 1.1 s, JPG _ PNG takes 1.8 s, and WebP is 39% faster than JPG _ PNG; Read 10,000 times, WebP takes 10 seconds, JPG _ PNG takes 19 seconds, and WebP format is 47% faster than JPG _ PNG.
SuperMap desktop supports direct opening of Tile in WebP image format, and also supports publishing the generated WebPTile as iSever service for viewing on iSever side. After the following World Map Tiles are published as iSever service, they are viewed in the browser in PNG and WebP forms, and the following results are obtained: at a certain scale, the number of tiles is 23, and the Picture Size of PNG is 751.91 KB. WebP's Picture Size is 137.3 KB. WebP reduces the file size by 80% compared to the equivalent PNG format, which improves page loading speed, reduces storage requirements, and helps speed up website graphics.
WebP adds extra decoding time, but because it reduces the size of the file and shortens the loading time, the rendering speed of the page is accelerated. At the same time, with the increase of the number of images, the loading speed of WebP pages is faster than that of PNG pages, so users can intuitively experience the performance improvement by using WebPTile browsing.