KhronosGroup / glTF

glTF – Runtime 3D Asset Delivery
Other
7.16k stars 1.14k forks source link

Extension for WebP for smaller images compared to jpeg #1503

Closed pjcozzi closed 5 years ago

pjcozzi commented 5 years ago

By Google. From https://developers.google.com/speed/webp/:

WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.

WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index.

Note that this is not GPU compression; this is a replacement for JPG-like compression.

The Cesium team's initial experience with WebP is very promising.

Ecosystem

Questions

lexaknyazev commented 5 years ago

iOS & Safari

Probably never, given that they support a different "JPEG-replacement" format.

Should this be an EXT or KHR extension?

KHR would likely require bringing IP in question, so I'd say EXT.

How should glTF reference this? Directly? via KTX2?

Directly, like JPEGs. KTX2 is for GPU-ready data.

In the near- and long-term, how does this play with CTTF GPU compression?

Nothing in the near term. Looking forward, we may borrow some techniques from it for the future (post-1.0) CTTF versions.

MarkCallow commented 5 years ago

Agree with @lexaknyazev, KTX2 is for GPU ready data.

If you can tolerate uploading uncompressed images to your GPU, i.e. you have vast amounts of memory, and transmission size is a problem then maybe webp is useful. However it is never going to be fully cross-platform. I think it not worth spending time on. We can already get JPEG-levels of compression with the under-development CTTF technology and there is likely room for further improvement and that is where time should be spent.

zellski commented 5 years ago

I'll add just a little agreement and a little disagreement:

pjcozzi commented 5 years ago

We can already get JPEG-levels of compression with the under-development CTTF technology and there is likely room for further improvement and that is where time should be spent.

@MarkCallow do you think this could approach WebP-level compression? If so, when?

In the meantime, WebP does fit a lot of use cases today - in particular in Cesium we literally deal with gigabytes and terabytes of texture data from aerial and satellite imagery - and WebP is making a measurable improvement in file size and download performance inline with their claims, about 30%.

At the least I would expect a vendor or EXT extension, but part of the question here is if there is enough interest for a KHR extension.

lexaknyazev commented 5 years ago

is enough interest for a KHR_ extension.

This might imply bringing the whole WebP file format spec to the Khronos IP Framework.

MarkCallow commented 5 years ago

@MarkCallow do you think this could approach WebP-level compression? If so, when?

We'll have to consult the oracle, Rich Geldreich. How does webp compare with JPEG?

MarkCallow commented 5 years ago

This might imply bringing the whole WebP file format spec to the Khronos IP Framework.

I'm not sure this is so. Core glTF uses JPEG but doing so didn't bring JPEG under the Khronos IP framework.

pjcozzi commented 5 years ago

is enough interest for a KHR_ extension.

This might imply bringing the whole WebP file format spec to the Khronos IP Framework.

Potentially. Draco is one example to consider, jpeg is another. We could discuss on the call and with Google.

We'll have to consult the oracle, Rich Geldreich. How does webp compare with JPEG?

😀

lexaknyazev commented 5 years ago

Core glTF uses JPEG but doing so didn't bring JPEG under the Khronos IP framework.

I think there's nothing to bring there - JPEG patents have expired already.

pjcozzi commented 5 years ago

For those following WebP here, please chime in on the pull request for EXT_image_webp by @OmarShehata: #1534

donmccurdy commented 5 years ago

Closing this issue – let's continue discussion in https://github.com/KhronosGroup/glTF/pull/1534.