WebP vs KTX2 for web textures

Hi people, i know KTX2 stays compressed in GPU, so it is much more VRAM friendly compared to JPG for textures, but how about WebP? Can WebP be better than JPG in the context of VRAM cost?

Because, i’m trying to find a sweet spot between file size and VRAM spaces as my interior app will run on web. Compressed WebP gives me greatest results in file sizes, better than compressed ktx2 textures (basisu etc1s). But, ktx2 will probably be best for the VRAM.

So i’m just looking an answer if, just maybe, WebP is somewhat not heavier like jpg for the VRAM, and if it is at somewhere between ktx2 and jpeg; i may choose WebP instead of the ktx2 for my interior textures, as my lossy compressed WebP’s are lower in file size, compared to my compressed ktx2 file sizes.

Do not trust me, this is just a guess:

JPEG does not reach VRAM, i.e. JPEG gets decoded into some raw data and these data are sent to the GPU. Most likely PNG is the same, its get decoded and then the raw data are sent to the GPU. If this is true, then the only significant difference is the files size and the network transfer speed; and from GPU perspective JPEG and PNG are indistinguishable.

1 Like

Like PNG and JPEG, WebP (and AVIF, and JPEGXL…) must be fully decompressed on the GPU to 4 bytes per pixel. They’re all the same in terms of VRAM.

I’m not aware of any format that remains compressed on the GPU and has better over-the-network compression than KTX2 with Basis Universal compression. It is currently pretty unique in that area.

1 Like

In case it’s helpful to anyone finding this — I wrote up a longer blog post on the subject here:

2 Likes