Expected KTX2 file sizes #443
-
Hey @donmccurdy , I was experimenting with KTX2 and using the gltf-Transform CLI to convert some existing models. I know file sizes can increase, but I'm seeing really significant growth, like 5x to 10x with uastc. Is this expected? I doesn't seem in line with other stats I have seen from others usage. I know it can vary texture to texture as well, but this seems to happen across the board for me. Some test output:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I do expect UASTC to be larger than JPEG in most cases, and possibly lossier, so if transmission size is a big concern then keeping those textures in other formats like JPEG, PNG, or WebP might be preferable at the cost of memory footprint. To my understanding the size of a UASTC texture (before ZSTD compression) is a function of its resolution, whereas JPEG or PNG textures could become arbitrarily small. And then with ZSTD applied, compression ratio is pretty sensitive to the amount of entropy in the image, so the final ratio between JPEG and UASTC can vary a lot. I'm not sure whether the numbers you're seeing are general or not though. What's the resolution on these textures? It could be worth extracting the textures and running similar |
Beta Was this translation helpful? Give feedback.
I do expect UASTC to be larger than JPEG in most cases, and possibly lossier, so if transmission size is a big concern then keeping those textures in other formats like JPEG, PNG, or WebP might be preferable at the cost of memory footprint. To my understanding the size of a UASTC texture (before ZSTD compression) is a function of its resolution, whereas JPEG or PNG textures could become arbitrarily small. And then with ZSTD applied, compression ratio is pretty sensitive to the amount of entropy in the image, so the final ratio between JPEG and UASTC can vary a lot.
I'm not sure whether the numbers you're seeing are general or not though. What's the resolution on these textures? It could b…