I have trouble to get a script working within Blender 2.8. What is the correct way to change Color Space mode of an image texture node?

node_opacity = nodes.new(type="ShaderNodeTexImage")
node_opacity.colorspace_settings.name = "Linear"

enter image description here


2 Answers 2


The colorspace is shown from the image data, it is not a node property.

node_opacity.image.colorspace_settings.name = 'Linear'
  • $\begingroup$ Wow.. I wouldn't expect to have to reach for the string value of its name.. $\endgroup$
    – Robin Betts
    Commented Jun 25, 2019 at 13:38
  • 2
    $\begingroup$ @RobinBetts despite the name, it is an enum. Will throw an error if you set it willy nilly enum "willynilly" not found in ('Filmic Log', 'Linear', 'Linear ACES', 'Non-Color', 'Raw', 'sRGB', 'XYZ') $\endgroup$
    – batFINGER
    Commented Jun 25, 2019 at 16:46
  • $\begingroup$ Thank you for the command, but when I set the image to Linear my normal map baked becomes black it loses all his informations. $\endgroup$ Commented Sep 30, 2019 at 11:25

If you would like to reference it with the node property, you can do

bpy.data.materials[0].node_tree.nodes['Image Texture'].image.colorspace_settings.name='Linear'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .