I was wondering would it be possible to also expose pipeline modules to LUA?
In this way it would be easier to automate certain tasks or create a quick and easy module.
As an example: I use regular the D&S module, I have a preset that gives nice local contrast. But sometimes this is too strong, so I then pair it with a uniform mask with opacity.
It would be really nice, if with a Lua script I could add a module with a strength slider. Then the lua script will set D&S and controls the uniform mask.
This is just an example. I see much more possibilities for this, to optimise the workflow and it faster to do certain task.
On a side note. Would you be willing to share this ānice local contrastā preset here? Some of the users here make great presets for the D&S module.
Why canāt you set that uniform mask in your preset, with an opacity of 100% initially (so you get the full effect). No need for Lua coding, and still only one slider to modify.
Creating modules from within Lua scripts will probably run in the same conceptual issues as allowing third-party plugins. And the required code infrastructure is going to be a nightmare.
Lua is meant for scripting, i.e. automating actions in the program you can also do manually. Creating a module isnāt something you can do manually within the programā¦
I donāt know much about adding a gui module but lua-scripting a shortcut to apply an instance of D&S, apply the preset and then create the mask for you, so all you have to do is reach for the opacity slider is certainly possible.
Of course you can⦠but that was not the point⦠it was an example. No need to help me with that.
I donāt think so. Because it will be build on top what is currently already out, you are in a much more stable environment. The script would set values of existing modules, no interaction with XMP etcā¦
Maybe my explanation was not sufficient. I think the word āmoduleā caused the confusion, sorry. I donāt mean a new pipeline module with its own pixel processing. I mean a small UI module, like the utility modules Lua scripts can already add to the panels. The Lua script would just control existing pipeline modules and set parameters.
So in my example, a āstrengthā slider in a Lua UI would do nothing more than set the D&S parameters and the opacity of the mask behind the scenes. Nothing new runs in the pipeline: no shared libraries to load, no new pixel code, no changes to pipeline order, and the history stack/XMP only contains the normal D&S and mask entries. Itās really just scripting what I could do by hand with the mouse, which is what Lua is meant for.
Not sure if I get you right, but you actually can add a LUA UI script to the panel in darkroom and execute a GUI action. See, e.g., the script gui_action.lua from the examples folder.
Lua was never supposed to be used in darkroom for image processing. We kind of skirt that by using dt.gui.action() calls to manipulate the user interface so that we can control the modules that are developing the image.
Because Iād suggest it would be better to allow mask-only presets, and/or applying a preset while keeping the current mask? These are sister features. It may be easier to implement now with coding assistants than when the issue was created.
Personally, Iād like a modifier key to control whether a preset is applied as mask-only or without-mask, and at the time of preset creation this could be an option when youāre prompted for the name.
Then why not make two presets? First create one with the mask, remove the mask, create a new preset (if such a second preset makes sense!).
Mask-only presets are harder, but can be faked with e.g. the exposure module (in combination with raster masks perhaps).
A modifier/option to keep current masking on applying a preset may make more sense than one about storing/not storing the mask when creating a preset.
That said, I consider presets and styles not something to use within one series of images, and to be thrown away after that series is finished. For those cases, copying a (partial) history stack makes more sense, in my opinion.