Compression time and file size

瀏覽次數:249 次
跳到第一則未讀訊息

Martin Over

未讀,
2023年2月16日 上午11:38:372023/2/16
收件者:WebP Discussion
Hi,
I am writing a community module for the geoserver.
Unfortunately the advantages of the smaller download size are cancelled out by a longer processing time.
Other map servers also have this problem: https://help.supermap.com/iDesktop/en/tutorial/MapTiles/WEBPTileType/

The larger the images, the greater this effect.
Why is this so?

best regards,

Martin

Maryla Ustarroz

未讀,
2023年2月16日 中午12:51:102023/2/16
收件者:webp-d...@webmproject.org
Hi,

That's a very good question actually! The short answer is that WebP achieves better compression rates than jpeg/png by being more complex, and the cost of this complexity is that it's slower, particularly at encoding.
The way WebP and other modern image formats work, is that they have many ways of representing the pixels of an image. One way might work well on one area of the image, while another way might work better in another area. To find the best way of encoding the image, the encoding software basically has to try several methods until it finds the best one. This is what takes time. Therefore, it's not usually advisable to convert images to WebP on the fly. WebP files should be generated in advance.

You can actually tweak the encoding time, by telling the encoder to try more or less combinations. Of course, if you tell it to try fewer options, it will be faster but you won't have as much compression gains.
Using cwebp, use the -m flag if using lossy compression (0=fast to 6=slowest) or -z flag for lossless (0=fast to 9=slowest])
Using the C api, you can change the "method" parameter on WebPConfig, or call WebPConfigLosslessPreset() for lossless.


--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.
To view this discussion on the web visit https://groups.google.com/a/webmproject.org/d/msgid/webp-discuss/0451b69a-c167-4b86-b997-540ca8b3e6d5n%40webmproject.org.

James Zern

未讀,
2023年2月16日 晚上8:20:352023/2/16
收件者:webp-d...@webmproject.org
On Thu, Feb 16, 2023 at 9:51 AM 'Maryla Ustarroz' via WebP Discussion <webp-d...@webmproject.org> wrote:
Hi,

That's a very good question actually! The short answer is that WebP achieves better compression rates than jpeg/png by being more complex, and the cost of this complexity is that it's slower, particularly at encoding.
The way WebP and other modern image formats work, is that they have many ways of representing the pixels of an image. One way might work well on one area of the image, while another way might work better in another area. To find the best way of encoding the image, the encoding software basically has to try several methods until it finds the best one. This is what takes time. Therefore, it's not usually advisable to convert images to WebP on the fly. WebP files should be generated in advance.

There are more details about some of the compression techniques here if you're interested:
 

You can actually tweak the encoding time, by telling the encoder to try more or less combinations. Of course, if you tell it to try fewer options, it will be faster but you won't have as much compression gains.
Using cwebp, use the -m flag if using lossy compression (0=fast to 6=slowest) or -z flag for lossless (0=fast to 9=slowest])
Using the C api, you can change the "method" parameter on WebPConfig, or call WebPConfigLosslessPreset() for lossless.


On Thu, Feb 16, 2023 at 5:38 PM Martin Over <overma...@gmail.com> wrote:
Hi,
I am writing a community module for the geoserver.
Unfortunately the advantages of the smaller download size are cancelled out by a longer processing time.
Other map servers also have this problem: https://help.supermap.com/iDesktop/en/tutorial/MapTiles/WEBPTileType/

The larger the images, the greater this effect.
Why is this so?

best regards,

Martin

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.
To view this discussion on the web visit https://groups.google.com/a/webmproject.org/d/msgid/webp-discuss/0451b69a-c167-4b86-b997-540ca8b3e6d5n%40webmproject.org.

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.

Martin Over

未讀,
2023年2月17日 清晨6:18:582023/2/17
收件者:WebP Discussion、James Zern
Thanks a lot for the quick answers!
回覆所有人
回覆作者
轉寄
0 則新訊息