# KTX2 compressed textures come out "Darker" than the originals

**URL:** <https://discourse.threejs.org/t/ktx2-compressed-textures-come-out-darker-than-the-originals/51618>\
**Category:** Questions\
**Tags:** gltf-loader, ktx2, basis\
**Created:** [May 15, 2023, 11:43pm UTC](https://discourse.threejs.org/t/ktx2-compressed-textures-come-out-darker-than-the-originals/51618 "2023-05-15T23:43:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mudebbela](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mudebbela/32/21007_2.png) [@mudebbela](https://discourse.threejs.org/u/mudebbela)\
**Post date:** [May 15, 2023, 11:43pm UTC](https://discourse.threejs.org/t/ktx2-compressed-textures-come-out-darker-than-the-originals/51618/1 "2023-05-15T23:43:44Z")

</div>

Hi, I have 2 glbs here, one is a ktxcompressed version. tldr i used the following script to create the compressed version:

gltf-transform etc1s hotel-3R9pgjEI.glb hotel-3R9pgjEI-ktx.glb

when placed side by side I notice the compressed version is dark to the point of looking texturless but i realized if I zoom in I can actually see the texture clearly. Anyone have an idea of what is causing this? I saw this happen with another gltf but that file is bigger and not really my work so I would have to ask permission before posting it here but here is the comparison I am referring to:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/4/4/446cc9d0fac6da19409fa8e52bf7770b5e8e6de2.png)

Notice how the texture on the left is darker on the lower image. To reiterate, I can see the texture if I get real close to the object so It definitely not missing or anything.

I’m not a pro at ktx2 compression and my end goal is to improve performance on mobile for a project I have been working on so please feel free to recommend better ways to compress this that will make it more effective. Ideally I want the two file to act exactly the same.

attached below you will find the two files in questions

PS: this is the same issue when compressing using etc1s and uastc.

[hotel-3R9pgjEI.glb](https://discourse.threejs.org/uploads/short-url/1fo79yNhdqZN0UnJ56mG7S55zNS.glb) (325.5 KB)  
[hotel-3R9pgjEI-ktx.glb](https://discourse.threejs.org/uploads/short-url/5wYpeBlRruvSZOfM5WGUQQPsOAY.glb) (358.2 KB)

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [May 16, 2023, 2:36am UTC](https://discourse.threejs.org/t/ktx2-compressed-textures-come-out-darker-than-the-originals/51618/2 "2023-05-16T02:36:22Z")

</div>

I don’t totally understand what’s happening here, but I can tell you it has something to do with mipmaps. Devices that don’t support WebGL 2 will require your texture dimensions to be in powers of two. And, apparently, this issue is fixed on devices that _do_ support WebGL 2 if you resize the textures to powers of two. glTF Transform has a flag to do that for you:

```bash
gltf-transform etc1s hotel-3R9pgjEI.glb hotel-3R9pgjEI-ktx.glb --power-of-two

```

The tell here is how the distance or viewing angle changes the result — WebGL changes between mipmaps at different distances and angles.

Feel free to file a bug about it anyway, I’m curious what’s actually going on here. 🙂

---

<div class="post-metadata">

**Author:** ![mudebbela](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mudebbela/32/21007_2.png) [@mudebbela](https://discourse.threejs.org/u/mudebbela)\
**Post date:** [May 16, 2023, 2:57pm UTC](https://discourse.threejs.org/t/ktx2-compressed-textures-come-out-darker-than-the-originals/51618/3 "2023-05-16T14:57:42Z")

</div>

Yup works perfectly after that change. I just learned something new 🙂 . Also I’ll file an issue about it soon. Thanks for the help
