How to set the options for decoding a raw camera file when creating a node with python?

I’m trying to automate some of my repetitive actions using a python script. Needless to say that my understanding of python is quite rudimentary.

I use the following to create a read node to read a canon cr2 raw file:

app1.createReader(“path/to/file.cr2”)

How can I pass options to set the color space to Hightlight Mode to “unclip” and set the expusure level?

screen

The tooltip reads:

rawHighlightMode

In the script editor I can read something like

app1.Read1.rawHighlightMode = app1.Read1.getParam(“rawHighlightMode”)

but what is the syntax to pass that option to the reader node?

rawReadCreate.zip (405 Bytes)

Just set path to your file in the script at this line :

rawRead.getParam('filename').set('')

Thanks for taking the time to respond.

rawRead.getParam(“/home/cegaton/Desktop/Scans/Raw/Incognito-03.cr2”).set(“”)

I get
File “”, line 18, in rawReadCreate

AttributeError: ‘NoneType’ object has no attribute ‘set’

You have to write the Path to your file in the set(’’)

Totally off topic:

The screenshot shows that one can select the demosaic method in Natron. I wasn’t aware of Natron being able to demosaic at all. Anyway, maybe have a look at the librtprocess project where the latest and fastest demosaickers from rawtherapee are available (I guess for natron demosaic speed is also important when using raw files)

Just a thought…

@fabiof17
The path is in set(’")

As far as I understand Natron is usin OpenImageIO to decode raw images.

I meant demosaic, not decode…

Sorry. i meant demosaic.

What’s the demsoaic time for ahd demosaic using OpenImageIO for a typical MP size used in Natron?
I ask because librtprocess may be faster in this aspect (not for ahd demosaic, but for exeample amaze in librtprocess is faster than ahd, and rcd is even faster than amaze), and if it is not faster than in OpenImageIo, I will have a look, how you got to speed it up :wink:

No, you set the path in the set(’’)
Example : set(‘C:\users\me\file.jpg’)
The getParam() must remain as it was in the script i uploaded.

OpenImageIO uses libraw to do the processing, and Natron uses OpenImageIO. If you really think librtdecode is a better option than libraw (which is probable), then this should be integrated in OpenImageIO, rather than adding this functionality in Natron. OpenImageIO is an industry standard and is supported by Sony Picture Imageworks. Natron is supported by… myself and a few crazy people.

@fabiof17 Thank you so much for your help! The script works wonderfully.

It’s not about decode speed, it’s about demosaic speed. But you are absolutely right that natron would be the wrong place for doing this. OpenImageIo or libraw would be the right place to call the fast demosaicers from librtprocess.

1 Like