Texture Tools default sRGB handling


I have a height map on the right computed in an external application, which saves the height values in f16 to EXR. I’ve also tested this with tangent space normal maps with the same results. Texture Tools seems to display and possibly handle the values as needing to be gamma encoded, causing them to appear brighter than they should. I’ve inspected the byte values of the images and they are not gamma encoded (as least in terms of how OpenEXR delivers the data to me), they are linear.

This leads to the somewhat amusing situation of needing to have two srgb to linear conversions when an external application actually is applying sRGB compression that I don’t want in the encoded blocks.

Maybe I’m misunderstanding something but this appears buggy to me.

Hi @jesse.r.meyer! I think there’s two places where color conversion is happening here. Just to double-check, what format are you having the Exporter save to?

  • The Texture Tools Exporter assumes .exr files contain linear colors; when displaying them onscreen or writing to an 8-bit-per-channel format, it converts from linear to sRGB. (For instance, EXR test images like GammaChart.exr and Desk.exr should appear correct in the Exporter.)
    • This means that if an .exr file contains normals, it’ll probably need an sRGB-to-linear conversion because the Exporter thinks it contains colors (that need linear-to-sRGB conversion).
  • Setting the Color Space in Blender to “Non-Color” makes Blender copy the raw values of an image to the color output. But Blender also uses linear colors for rendering and displays on-screen using a view transform and an sRGB display device.
    • So (if I’m not mistaken) the Non-Color setting for the normals here will be correct when plugged into a Normal Map node followed by the Normal input of a BSDF, but will look too bright when plugged into the Base Color input.

Here’s an example I quickly put together:

Normal map:

In Blender:

Attached to the Color input instead, it looks too bright (note that I’m using Render Properties > Color Management > View Transform > Standard here; with Filmic, it’s more washed out):

Hope this helps!

Firstly, thanks for your thoroughness!

I was exporting to BC5u. It turns out there’s behavior on Blender’s side that the devs themselves consider problematic (#121716 - Invalid files produced from some color space and format combinations - blender - Blender Projects). Linear vs sRGB seems to be a perennial problem.

Ok, good to know TT assumes .exr are sRGB gamma compressed colors.

Thanks @jesse.r.meyer! (Just a quick note on the last paragraph, it’s the opposite - the Exporter assumes .exr files are linear, without sRGB. It doesn’t know the input is a normal map (it’ll do something different when transforming colors to normals), so it assumes the input is a color map, and that colors should be stored sRGB-encoded in BC5u files, so it converts linear to sRGB.)

Thanks again!