# Don't trust PVRTexToolCLI or PVRTexToolGUI handling of sRGB

**URL:** <https://forums.imgtec.com/t/dont-trust-pvrtextoolcli-or-pvrtextoolgui-handling-of-srgb/3259>\
**Category:** PowerVR Insider\
**Tags:** pvrtextool\
**Created:** [August 14, 2020, 6:24pm UTC](https://forums.imgtec.com/t/dont-trust-pvrtextoolcli-or-pvrtextoolgui-handling-of-srgb/3259 "2020-08-14T18:24:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alecazam123](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/alecazam123/32/258_2.png) [@alecazam123](https://forums.imgtec.com/u/alecazam123)\
**Post date:** [August 14, 2020, 6:24pm UTC](https://forums.imgtec.com/t/dont-trust-pvrtextoolcli-or-pvrtextoolgui-handling-of-srgb/3259/1 "2020-08-14T18:24:40Z")

</div>

This is using the April 2020 release of PVRTexToolCLI (Build 4.23) and GUI (Build 20.1) on macOS 10.15.6. The samples shown are ASTC4x4 encoded 4x4 textures and I’m using astcenc.

I’m only able to visually verify this content is correct off the preview thumbnail (which mostly looks like the texture in the upper left), since KTX thumbnails in macOS don’t handle sRGB. PVRTexToolGUI gives totally different results from Preview for the PNG and KTX file. My display is set to sRGB as well.

DCM (digital color management tool) says the following for red:  
Preview PVRTexToolGUI  
png 64 13  
ktx 136 64

 ![image](https://us1.discourse-cdn.com/flex015/uploads/imagination1/original/1X/cc1d9520e2c7714c36636694418a4b64cd4fe05c.png)

![AttribSimple](https://us1.discourse-cdn.com/flex015/uploads/imagination1/original/1X/ba01dce006193c31cda6896786b44f27f4eeeb8d.png)  
Your website doesn’t allow upload of KTX format files, so this is the command to process that file.  
PVRTexToolCLI -f ASTC\_4x4,UBN,sRGB -i AttribSimple.png -o AttribSimple.ktx

sRGB handling should purely affect mipmap generation where srgb to linear conversion occurs at higher than 8-bit depth, mips are filtered, converted back to 8-bit sRGB, and then sent to encoder. Ideally higher bit depth linear pixels would be sent to encoding, and endpoints converted back to sRGB after fitting the point cloud, but that is more involved and difficult with 565 encodings like BC1-3.

---

<div class="post-metadata">

**Author:** ![alecazam123](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/alecazam123/32/258_2.png) [@alecazam123](https://forums.imgtec.com/u/alecazam123)\
**Post date:** [August 14, 2020, 11:30pm UTC](https://forums.imgtec.com/t/dont-trust-pvrtextoolcli-or-pvrtextoolgui-handling-of-srgb/3259/2 "2020-08-14T23:30:18Z")

</div>

It looks like 4.24 significantly improves the sRGB handling over 4.23. The results still don’t match the png file. I read a red of 68, and a red of 64 in the original png file from DCM, but I’ll try the comparison tool. This is DCM + Preview + Display set to SRGB. Also cuttlefish also gens a red of 68, so it could just be Preview handling the KTX pixels differently.

The PVRTexToolGUI was from the 4.24 release, so that still has dark colors as reported elsewhere on the forums.

---

<div class="post-metadata">

**Author:** ![omarzohdi](https://avatars.discourse-cdn.com/v4/letter/o/6de8d8/32.png) [@omarzohdi](https://forums.imgtec.com/u/omarzohdi)\
**Post date:** [August 17, 2020, 3:39pm UTC](https://forums.imgtec.com/t/dont-trust-pvrtextoolcli-or-pvrtextoolgui-handling-of-srgb/3259/3 "2020-08-17T15:39:22Z")

</div>

Hi, alecazam123,

We’re aware of an issue in PVRTexTool 4.24 where the image displayed in the PVRTexTool GUI viewer appears darker than it’s supposed to.

Our internal investigation found out that:

- PVRTexTool 4.23 may display correctly, but the values contained are actually incorrect (too bright).
- PVRTexTool 4.24 encodes the correct values in the texture, but the viewer (and only the viewer) is too dark.

You can find a more detailed explaination about the issue in this Github [Issue](https://github.com/powervr-graphics/Native_SDK/issues/59#issuecomment-658094490).

We’re planning on releasing a fix for this issue in the 20.2 release in the meantime we recommend using PVRTexTool 4.24.

Thank you.  
Regards,  
Omar.
