# Failed to load KTX2 texture data: Error: KTX2 container - could not transcode the data. TypeError: Cannot convert "undefined" to unsigned int

**URL:** <https://forum.babylonjs.com/t/failed-to-load-ktx2-texture-data-error-ktx2-container-could-not-transcode-the-data-typeerror-cannot-convert-undefined-to-unsigned-int/38726>\
**Category:** Bugs\
**Tags:** texture, ktx2\
**Created:** [March 3, 2023, 9:15pm UTC](https://forum.babylonjs.com/t/failed-to-load-ktx2-texture-data-error-ktx2-container-could-not-transcode-the-data-typeerror-cannot-convert-undefined-to-unsigned-int/38726 "2023-03-03T21:15:56Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![RPaladin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rpaladin/32/27367_2.png) [@RPaladin](https://forum.babylonjs.com/u/RPaladin)\
**Post date:** [March 4, 2023, 8:08pm UTC](https://forum.babylonjs.com/t/failed-to-load-ktx2-texture-data-error-ktx2-container-could-not-transcode-the-data-typeerror-cannot-convert-undefined-to-unsigned-int/38726/9 "2023-03-04T20:08:36Z")

</div>

Here are all of the supported KTX2 decoder types for Babylon.js:

> <https://github.com/BabylonJS/Babylon.js/tree/master/packages/tools/ktx2Decoder/src/Transcoders>
>
> //github.com/BabylonJS/Babylon.js/tree/master/packages/tools/ktx2Decoder/src/Transcoders

Here is also a list of supported formats for KTX texture containers for WebGL:

> **[Multi-Platform Compressed Textures | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/mutliPlatTextures#khronos-texture-container-format-ktx-files)**
>
> Learn all about multi-platform compressed textures in Babylon.js.

* * *

Unrelated, for those unsure what the differences are between KTX and KTX2, here’s a good summary:

> [@KTX vs KTX2 format](https://forum.babylonjs.com/t/ktx-vs-ktx2-format/37502/2):
>
> KTX2(and .basis) have this “Universal supercompression” Meaning that once downloaded, a worker thread transcodes them to a real compression format. Meaning it picks the optimal format for the hardware the person is viewing with and that is what’s sent back to main thread The first article is talking about device specific the ‘older’ way. Which is you offline generate a version of a texture for each different CPU (mytex-astc.ktx, mytex-etc2.ktx, mytex-pvrtc.ktx etc etc ). Babylon for instance t…

---

_[View the full topic](https://forum.babylonjs.com/t/failed-to-load-ktx2-texture-data-error-ktx2-container-could-not-transcode-the-data-typeerror-cannot-convert-undefined-to-unsigned-int/38726)._
