Sub topic 9
Choosing the right color space for each image
This chapter assumes you can connect an Image Texture node to a Principled BSDF and that you know what UV coordinates do. It covers one setting on the Image Texture node, the Color Space dropdown, and why a wrong value ruins a render without raising any error.
Why an image needs a color space
An image file stores numbers. Blender must know what those numbers mean before it uses them in a shader. The color space is that meaning. It is a rule for converting the stored values into the linear values Cycles and EEVEE use for lighting math.
Two cases come up constantly:
- Color data is meant to be looked at. A brick photo, a painted wood albedo or a logo is color data. Image editors save it with the sRGB curve, which spends more of the 8-bit range on dark tones because human vision is more sensitive there. Blender must undo that curve before shading.
- Non-color data is numbers that drive a shader. A roughness map, a metallic mask, a normal map or a height map is non-color data. A pixel value of 0.5 means "half rough", not "a mid-gray color". No curve was applied, so none should be removed.
If you treat data as color, Blender applies the sRGB-to-linear conversion to numbers that were never encoded that way. The values shift and the shading is wrong.
What the conversion does to a value
The sRGB decode curve is not a simple multiplication. A stored value of 0.5 decodes to about 0.214 in linear space. A stored 0.2 decodes to about 0.033. Mid-tones get much darker, while 0 and 1 stay put.
Consider a roughness map painted as a flat 0.5, meaning a semi-glossy surface. If the node is set to sRGB, the shader receives about 0.214. The surface renders much glossier than you painted it. A normal map is more severe. Its RGB channels encode vector directions, and the decode bends every vector, so lighting on the surface looks tilted or flat in the wrong places.
The common options
The dropdown lists the color spaces defined by the active OpenColorIO configuration. The ones you will actually use are few.
| Color space | Use it for | What Blender does |
|---|---|---|
| sRGB | Base Color, emission color, any image meant to be seen as color | Decodes the sRGB curve to linear |
| Non-Color | Roughness, metallic, normal, height, ambient occlusion, masks, ID maps | Passes stored values through unchanged |
| Linear Rec.709 | Images already stored as linear color, such as many EXR renders | Treats values as linear color without a curve |
In older Blender versions (2.x and 3.x) the linear entry is named "Linear". The name changed in newer releases, so check your dropdown.
Do not confuse these with the view transform (Standard, Filmic, AgX) in Render Properties under Color Management. The view transform converts the finished linear render into something your monitor shows. The image color space is a per-image input setting. They act at opposite ends of the pipeline.
Matching the image to the socket
A reliable habit is to decide the color space from the socket you are about to plug into, not from how the image looks.
| Principled BSDF input | Image holds | Color space |
|---|---|---|
| Base Color | Color | sRGB |
| Emission Color | Color | sRGB |
| Roughness | Scalar values | Non-Color |
| Metallic | Scalar values | Non-Color |
| Alpha | Scalar values | Non-Color |
| Normal (through a Normal Map node) | Vectors | Non-Color |
| Displacement or Bump height | Scalar values | Non-Color |
Alpha needs a short note. If the alpha comes from the image's own alpha channel, you connect the node's Alpha output. The image's alpha mode setting then controls how that channel is read. If the alpha is a separate grayscale mask, the mask is data, so use Non-Color.
A gray-looking roughness image is easy to misjudge. It looks like a color picture, so people leave it on sRGB because that is the default. Judge by purpose.
Where the setting lives and how defaults work
The Color Space dropdown appears on the Image Texture node itself, under the image selector. It is also in the sidebar (N panel) of the Image Editor.
The setting belongs to the image data-block, not to the node. This has two consequences:
- If two Image Texture nodes use the same image data-block, they share one color space. Changing it on one node changes it on the other.
- If you need the same file as both color and data, load it as two separate image data-blocks. For example, a packed ORM texture could feed Base Color from one channel and roughness from another. In that case the data channels dominate, so use Non-Color and avoid using the same data-block for visible color.
Blender picks a default when it loads a file. 8-bit formats such as PNG and JPEG default to sRGB. Float formats such as OpenEXR and Radiance HDR default to a linear space. Blender cannot know that your PNG is a roughness map, so every roughness PNG arrives set to sRGB until you change it.
If you build materials through the Image Editor or an add-on, the importer may set the color space for you. Check the result instead of assuming it.
Setting the color space with Python
In bpy, the color space is image.colorspace_settings.name. The names are strings that must match the dropdown exactly. The script below builds a material with a color image and a roughness image, then sets the color space for each. It generates the images instead of loading files, so it runs in any scene. The Principled BSDF sockets use the Blender 4.x names.
import bpy
mat = bpy.data.materials.new("ColorSpaceDemo")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
bsdf = nodes["Principled BSDF"]
# Color image: new images default to sRGB.
color_img = bpy.data.images.new("DemoColor", width=256, height=256)
color_img.colorspace_settings.name = "sRGB"
# Data image: is_data=True creates the image with Non-Color already set.
rough_img = bpy.data.images.new("DemoRoughness", width=256, height=256, is_data=True)
color_tex = nodes.new("ShaderNodeTexImage")
color_tex.image = color_img
color_tex.location = (-500, 200)
rough_tex = nodes.new("ShaderNodeTexImage")
rough_tex.image = rough_img
rough_tex.location = (-500, -100)
links.new(color_tex.outputs["Color"], bsdf.inputs["Base Color"])
links.new(rough_tex.outputs["Color"], bsdf.inputs["Roughness"])
print(color_img.name, "->", color_img.colorspace_settings.name)
print(rough_img.name, "->", rough_img.colorspace_settings.name)The printed lines should read DemoColor -> sRGB and DemoRoughness -> Non-Color.
When you load files instead, set the color space right after loading and before you render:
import bpy
def load_image(path, is_color):
"""Load an image file and set its color space by purpose."""
img = bpy.data.images.load(path, check_existing=True)
img.colorspace_settings.name = "sRGB" if is_color else "Non-Color"
return imgThe check_existing=True argument returns an image already loaded from the same path. This is convenient, but it means the data-block, and therefore its color space, is shared. If you load the same file once as color and once as data with this flag, the second call overwrites the first call's setting. Use check_existing=False when you need two independent data-blocks.
Checking an existing material
When you inherit a file, you can audit every image at once. This script lists each image with its color space and the sockets that its nodes feed.
import bpy
for mat in bpy.data.materials:
if not mat.use_nodes:
continue
for node in mat.node_tree.nodes:
if node.type != "TEX_IMAGE" or node.image is None:
continue
targets = [link.to_socket.name for link in node.outputs["Color"].links]
print(
f"{mat.name}: {node.image.name} "
f"[{node.image.colorspace_settings.name}] -> {targets}"
)A line such as Brick: brick_rough.png [sRGB] -> ['Roughness'] shows a mistake straight away. Note that a Normal Map node sits between the image and the BSDF, so the target will read as Color on that node. Check the image name or the node chain for those.
Common errors
- Roughness looks too glossy or too dull. The map is set to sRGB. Change it to Non-Color.
- Normal-mapped surface looks flat, or lit from the wrong side. The normal map is set to sRGB. Set it to Non-Color. If the bumps look inverted instead, the cause is a different convention (OpenGL versus DirectX green channel), not color space.
- Base color looks washed out and pale. The color image was set to Non-Color, so its values were not decoded and now read too bright. Set it to sRGB.
- Changing one node changes another. They share an image data-block. Duplicate the data-block (the duplicate button next to the image name) if they must differ.
- Color space resets after reopening. The image file is missing or was never saved, so Blender reloaded it with defaults. The next chapter covers saving and packing.
Exercises
Exercise
A roughness map stores a uniform pixel value of 0.5. You leave its color space on sRGB. Approximately what roughness value reaches the shader, and why is that a problem?
Show answer
About 0.214. Blender applies the sRGB-to-linear decode to a value that was never sRGB-encoded, so the surface renders glossier than the 0.5 you painted. Setting the image to Non-Color passes 0.5 through unchanged.
Exercise
Which color space should each image use? (a) a painted wood albedo PNG plugged into Base Color, (b) a metallic mask PNG, (c) a tangent-space normal map PNG, (d) an emission color image.
Show answer
(a) sRGB, (b) Non-Color, (c) Non-Color, (d) sRGB. Albedo and emission colors are meant to be seen as color. Metallic and normal maps are numbers that drive the shader.
Exercise
You load brick.png once as a color map and once as a data map, using bpy.data.images.load(path, check_existing=True) both times. Why can this give a wrong result, and how do you fix it?
Show answer
check_existing=True returns the same image data-block for both calls, and the color space belongs to the data-block. The second setting overwrites the first, so both nodes use one color space. Load with check_existing=False to get two independent data-blocks, then set each one separately.