How to invert B&W texture in nodes?

How to invert B&W texture in nodes?

How do I invert a B&W image (used for reflection and or Transparency) in a node set up?
 
Step Node

There are many nodes, mostly math, that I don't understand, but the Step node seems to be a handy one for simpler tweaks that make sense just by looking at the results. In particular, it can do a lot of things with gray scale values. Worth some experimentation.
 

Attachments

  • step.png
    step.png
    260.9 KB · Views: 279
  • step.jas.zip
    48.6 KB · Views: 192
Last edited:
Never used the step node before - very interesting. It sort of worked for inverting my image but the effect was too strong (and reducing intensity of the image in the image node didn't work). I just inverted it in Photoshop and got look I wanted.
 
One way is to use the subtract node:
Set the A input to 1,0,0 and plug the image output into B.
This Method inverts values <0 and >1 properly.
B/W is one channel only and you need only the first of three and can use the value output.

Or you take a gradient node and swap the colors (white to black and vice versa).
This will clip the source to the 0 to 1 range and also turn colored input into b/w by taking the first (red) channel.
Also you can insert another slider in the middle and then adjust the brightness.
 

Attachments

  • screenshot.jpg
    screenshot.jpg
    47.8 KB · Views: 277
Last edited:
I was able to adjust the intensity of the reflection.
In this case I would use the gradient and set the white slider to 95 instead of 100 f.i.
Because when you lower the first term of the subtract node, you will get negative blacks (the whole range gets shifted down: 1->0.95 ; 0 -> -0.05).
 
Just tried Gradient node too. Adjusting the middle slider limited where in my mask the effect occurred but it did not reduce its intensity. The areas of reflectivity looked too much like grey metal. Actually the Subtract node with reduced "A" value gave me more of what I wanted. It made the reflective areas less grey and more white.
 
Ok, what works, works :tongue:

I'm just cautious from experience about negative values, they can cause all kinds of weirdness in the course of further node refinement, therefore range awareness is paramount imho.
 
I found that I had an object inside my mesh and I think that was influencing how the subtract and gradient nodes were effecting the texture. Things worked a bit cleaner after removing that object.
 
Back
Top