How can I replicate the Photoshop invert command in Natron?

Hello everyone, I’ve recently discovered this software and I really like it so Thank You everyone that worked on the project and help created this piece of software. I have a background of using After Effects and while that software does a lot of things you can’t beat the modern node workflow.

But I have a question.

I’m using Natron right now to generate textures images for unity game engine where I need to pack various textures in various channels then pack in one single texture.

I’ve managed to set everything up input files, output files and all works great. I really love the Render button available on the output file node which is really handy when you have multiple outputs in the same project.

Now I need to invert a channel. If you are familiar with photoshop, if you select a layer or a directly a channel, lets say green then go to the menu Image - > Adjustment → Invert

it will invert the channel or image.

How do I do this in Natron?

I’ve found in Natron the Color → Invert option but it doesn’t work as expected.

You can see in this image how the inverted image should look in the right image from photoshop and how it looks in Natron.

What did I do wrong and how do I fix it?

Thank You for the help

Tested in Natron, Nuke, and Photoshop. Natron and Nuke return the same result, looks like Photoshop applies some form of gamma correction? Photoshop’s invert also isn’t available when working in 32 bit mode. I’d be willing to bet that Natron and Nuke’s math is better here, though if you’d like the same effect as Photoshop add a grade node below the invert and adjust the gamma to taste. Note that you probably shouldn’t do this adjustment for anything other than RGB channels.

Photoshop (very) probably inverts the sRGB values, so the correct workflow would be:

  • unpremult
  • convert linear to sRGB (no (un)premult
  • invert RGB (no (un)premult)
  • convert sRGB to linear (no (un)premult)
  • premult

Photoshop has been doing operations on sRGB for a long time (including compositing, even if it has a setting to switch to correct compositing).

Attached a sample project.

invert_srgb_like_photoshop.ntp (27.5 KB)

1 Like

Looks like you’re correct. After converting to profile > Custom RGB > Gamma 1.0 Photoshop returns the same image.

Ok yes off course, this makes total sense, I didn’t cared about the color space because the output images looked fine to me and got this issue when trying to invert a normal ma channel. That one needs to work perfectly else everything breaks

ok so I don’t want to recreate the entire project and after a few tries I’ve basically got it to work by changing the LUT option in project settings to use sRGB

then change the file and Output color space for the read node to sRGB the output was set to Linear

and whatever node have anything to say about color space I’ve tried to put it to sRGB is that option existed just in case

this looks like is working as I need