Python image processing node in Natron.

Hi, I’d like to know if a python image processing node could be possible ?

The idea is to make Natron extension open to programmers uncomfortable with C, compilation, building process (like me :frowning: )
I know G’MIC and ShaderToy are good options but the lack of external librarys requires to reinvent the wheel.

use case could be something like this:

It’s also several years that the lack of optical flow and warp tools in Natron are the only things that prevent me to use it in my daily VFX compositing work. All this seems to be present in OpenCv.
And in the future it may be a good doorway for AI tools in Natron without leaving all the heavy work on @devernay and @rodlie shoulders!
(again thanks to them for all the amazing work)

The node would “simply” handle the input images to the code as numpy array, opencv image or similar. And also get the result from an other “result” array.

My understanding is that nuke and natron didn’t consider this when python didn’t have such powerful librarys such as opencv but this may now be very desirable…

Thanks for reading my awaken dreams !

If you’re on Linux or maOS, there’s a node called “runscript” that allows you to run any external program, including a Python script.
Python is not a good language for image processing within Natron, because it’s single-threaded, so the execution of one node would block all of Natron. With an external process, you’re safe.


I believe that if you were to implement OpenCV, it would have to be through an OFX plugin of some sort. Python may be easier to use, but as devernay pointed out, it would not be a good idea performance wise.

Thank you both! I’m out of luck:

  • stuck on windows because my nvme drive hangs any linux distro :frowning:
  • I don’t know enough C to make OFX plugins .

What is left to me is dreaming @devernay would release his optical flow tests as an OFX !

I moved the discussion on OF to another topic: Optical flow computation for Natron: what for?

I should probably look into getting this node to work on Windows.

It would be great!