Node Editor - invert

Node Editor - invert

Hi.

I'm looking for a Node in the Node Editor to invert a texture map.
I couldn't find one. Is there a possibility to create one?

Thanks
Wolfgang
 
the SUBTRACT node (in the Math category) will do the trick.

• Create a new material - in the Node editor, create a new IMAGE & SUBTRACT node.
• Set the "A" value in the SUBTRACT node to "1.0"
• Plug in the "Color" from your IMAGE node (that has the height map loaded) into the "B" value of the SUBTRACT node.
• Plug in the the "Val" of the SUBTRACT node into the "Bumpmap" of the MATERIAL node.

done :)
 

Attachments

  • Screen shot 2013-09-30 at 4.03.08 AM.png
    Screen shot 2013-09-30 at 4.03.08 AM.png
    66.6 KB · Views: 765
Hi Rene66.

Thanks a lot ... I will try this out! :wink:
I'm wondering how you can figure this out ... :rolleyes: ... but anyway ... hopefully it works! :D

Thanks again,
Wolfgang
 
We learn by playing around with things - and reading posts on the forum. This inverse trick I learned from a post by Podperson.

With the nodes, it's all math I have discovered and Colors are like percentages: 0.0 = 0%, 0.6 = 60% and 1.0 = 100% etc.. In this case we're dealing with a bump map which is grey scale 0.0=black & 1.0=white.

If a pixel on your bumpmap is 67% grey and you need the inverse (33%) - using the SUBTRACT node gets you there.

(A)1.0 - (B) 0.67 = .33 (33%grey)

Hope that helps clarify what's happening with this "trick" - Continuing playing
 
Hi Rene66.

I used the technique to invert an external gradient map and it works very well with it as far as I can see. :icon_thumbup:

I'm not sure that I can handle it with all kind of image maps, but we will see.

Thanks again,
Wolfgang
 
A color image map can be inverted by subtracting from 1.0 in x y and z (which act as R G and B).

You can also brighten, darken, increase contrast, and -- if you're clever -- apply gamma correction. If you want to apply "curves" you can create a black-to-white gradient in Photoshop, apply the curve to that gradient, and then use a slice of that image as a "look up table" (if you're interested, I can post more details on this).

It's all arithmetic or a little algebra.

E.g. brighten an image, use an add node to add a small amount (e.g. 0.1, 0.1, 0.1) or add a color (e.g. light gray). To manipulate contrast, subtract 0.5, 0.5, 0.5, and then multiply by a number (1.0 has no effect; 2.0 increases contrast, 0.5 decreases contrast), and then add back 0.5, 0.5, 0.5.

(You'd be shocked at how simple most of the things Photoshop does are at a pixel level — my favorite discovery from a paper on this stuff was that sharpening is done by blurring an image and then subtracting that image from the original (!). Think of it as Sharpened Pixel = Original Pixel x ( 1 + epsilon ) – Blurred Pixel x epsilon. If you use a matrix blur you get crude sharpening, if you use guassian blur you get unsharp mask.)
 
So you´re saying you can invert a colored map with the subtraction-node? All I see is inverted brightness not inverted RGB-values here.
I´m used to use another approach to invert colors. Just curious. ;)

Cheers
Frank
 
Yes that's exactly what I'm saying.

E.g. red: 1.0, 0, 0 inverts to 0, 1.0, 1.0 (cyan).

Edit: added example showing invert, brightness, contrast, and curves (!) using C3D nodes.
 

Attachments

  • subtraction.jpg
    subtraction.jpg
    372.7 KB · Views: 776
  • Screen Shot 2013-09-30 at 9.21.03 PM.png
    Screen Shot 2013-09-30 at 9.21.03 PM.png
    56.2 KB · Views: 774
  • node image filters.zip
    46.8 KB · Views: 488
Last edited:
Hi everyone
Podperson or anyone.

Are there math node equivelents to blending modes such as 'screen' & 'lighten', 'darken', 'overlay', 'softlight' etc. that you find in image editing apps?

Thanks, Shift Studio.
 
Back
Top