📜 ⬆️ ⬇️

WebP vs BPG

A very long time ago the most popular formats remain: JPEG - for lossy compression, PNG - for lossless compression and GIF for animation. These formats are supported by all browsers and web applications.

But the more images poured into the Internet, the more acutely the need for a better format. To save space on the server, to speed up page loading and to save designer time.

If you measure the weight of all the photos on the page - sometimes you can get a heart attack. The more photos, the more page weighs and the longer it loads.
')
Several formats have already been created that have every chance of replacing both JPEG and GIF and PNG. Very good results show Google WebP and "free" BPG .
image

Both formats are based on the compression of key frames in video codecs. WebP works on VP8 technology, and BPG works on HEVC (H.265).

What is BPG?


BPG is based on HEVC (H.265) video codec coding technology. Splits the image into blocks of different sizes, depending on the content. Supports 14 bits / channel, transparency, metadata, can compress with losses and without. Here is the BPG specification on the developer’s site.

What is WebP


Based on Google’s VP8 video codec coding technology. How the WebP is arranged is described in detail here .

It supports lossy and lossless compression, transparency, metadata and animation and has the ability to compress the image without compressing the alpha channel.

Comparing BPG and WebP


Visual comparison

A comparison was made using this tool. Sample: 10 pictures of different sizes. The experiment showed that BPG compresses an average of 20% better than WebP. Although the spread is quite large from 42% to 0% . Sometimes the difference was only 1 kb , and sometimes much more . At the same time, the visual quality of the image remained the same.

If you click through all the pictures on this resource , then in the small, medium and large modes, small details on the BPG look even clearer. In tiny mode, the visual quality of the image is better in WebP format, while BPG blurs small details.

Browser Support

BPG is a opensource, but it is built on the basis of HEVC, which has many related patents. There are so many owners of these patents that they even created a group called MPEG-LA. This group includes Apple and Microsoft. This explains why they have not yet adopted the WebP format.

BPG is not supported by any browser. The first can be Safari and possibly IE. WebP is distributed under the BSD license and has support in Chrome, Opera browsers and Android web applications.
WebpBPG
Loss++
Lossless++
Meta++
Alpha++
EncodeVP8H.265
LicenseBSDOpensource + patents
SupportChrome, Opera, Android-

Conversion

To embed BPG on the site, you need to connect the js decoder . Convert from JPEG to BPG using ImageMagick:

convert image.jpeg image.bpg 

From other formats in WebP, you can convert using a special utility - cwebp and vice versa - the dwebp decompressor:

 cwebp -q 85 -lossless input.png -o output.webp 

 dwebp input_file.webp -o output.png 

Also, the utility can perform simple image editing: crop and resize.

This article is written thanks to one of the comments on the article WebP device .

Abstract


  1. BPG is encoded with H.265 video codec, and WebP with VP8.
  2. BPG compresses better by an average of 5-10%.
  3. WebP has partial browser support, BPG is not supported at all.
  4. You can embed BPG on the site using JS.

Source: https://habr.com/ru/post/261971/


All Articles