Working with modules from Lua scripts in darktable

Bielefeld? Das gibts wirklich?? :rofl:

This question was really unexpected :slight_smile: - Yes, despite all the rumours: This city of Bielefeld in East Westphalia really does exist :slight_smile:

2 Likes

Okay, here is my try to incorporate local contrast into your script, as well as the option to apply the tone equalizer medium shadow/highlight compress, which I often use when processing pictures with strong backlighting.

InitialWorkflowModule.zip (5.3 KB)

Thanks again for the template, this is a fun project.

BTW: I am from Frankfurt, but have been living in the US for 20+ years.

Hi @Sciencenerd,

thanks for your additions. Currently I try to add them to the next version of the script.

There seems to be a bug in tone equalizer module: Using lua to set ā€œcompress shadows-highlights (eigf):ā€, only ā€œmediumā€ works. If I replace medium with ā€œsoftā€ or ā€œstrongā€, the action path is not found. Can you reproduce that?

dt.gui.action(ā€œiop/toneequal/preset/compress shadows-highlights (eigf): mediumā€, 0, ā€œbuttonā€, ā€œonā€, 1.0)

1 Like

Medium is first in the preset listā€¦could it be you also need to specific the position in the list??

I donĀ“t think so, because others like ā€œ(gf): softā€ work.

I only tried the tone equalizer compress highlights/shadows medium preset. Iā€™ll have to try the other presets when I have more time over the weekend, unfortunately, I have to work tonight and the next two nights.

As to the script, I also had a problem like the one reported in an earlier post in this thread, when some images are processed multiple times. In darkroom view, it looks like the script is moving on to the next image in the filmstrip, but it is reprocessing the same image. Eventually, it moves on, but then one or several images were skipped (not processed). I have tried to trouble shoot with the logging function, but my lua script skills are not good enough yet to figure out the problem.

Again, this is a great script and thanks for contributing and improving it.

@Sciencenerd, thanks for your support. That definitely has time until the weekend.

I will investigate the reported problem, but I canā€™t reproduce it yet. It may not happen in my current version.

Do you use the official DT 4.2 release? Or any newer DT 4.3 nightly build?

I have darktable 4.2 on windows. I have a feeling that it has something to do with the processing not complete before the script wants to move on to the next image, but I have no evidence for this. I did, at one point, try to turn on the higher level debugging in the script
debug.max_depth = 3
log.msg(log.always, 4, dt.debug.dump(image))
local d = dt.gui.libs.modulegroups
log.msg(log.always, 4, dt.debug.dump(d)))

and this seemed to improve things a lot (but did not 100% eliminate the issue), maybe be slowing down the script?

do you process multiple images from lighttable view?

maybe the script doesnt allway wait until the single steps are finished.

Give me some time, I will post the new version in a few days. Perhaps that will solve it.

It was a crazy guess but stranger things as they often say ā€¦ā€¦

I need to learn some of this codeā€¦ :blush:ā€¦ It will have to wait for nowā€¦

thats okay, you could wait for the next version.

The last days I learned a bit about lua and made a complete rework. It will be easier to extend (and perhaps to understand).

Iā€™m still learning, coming from .Net itā€™s a new language for me, and a new API. But itā€™s fun :slight_smile:

Good Night :slight_smile:

1 Like

Yes, I always select multiple images in lighttable view, then start the script. In fact, when I select multiple images in darktable, the script only processes the currently viewed, active image and then stops.

If you do the same for something like export it will only export one image when in darkroom view as wellā€¦

1 Like

Hi Uli,

I just tried and can replicate our finding that some presets in Tone Equalizer (for example compress h/s (eigf) soft and strong) donā€™t work when called the LUA script. I have no idea why.

Chris

@wpferguson Bill might have a thought on this one??

medium works:
dt.gui.action(ā€œiop/toneequal/preset/compress shadows-highlights (eigf): mediumā€, 0, ā€œbuttonā€, ā€œonā€, 1.0)

others like ā€œ(gf): softā€ work, too, but ā€œ(eigf) softā€ and ā€œ(eigf) strongā€ do not work.

try

dt.gui.action(ā€œiop/toneequal/preset/compress shadows/highlights (eigf): mediumā€, 0, ā€œā€, ā€œā€, 1.0)

same result for ā€œstrongā€ and ā€œsoftā€:

[dt_action_locate] action ā€˜compress shadows-highlights (eigf): strongā€™ doesnā€™t exist
[dt_action_process] action path ā€˜iop/toneequal/preset/compress shadows-highlights (eigf): strongā€™ not found

The git version of dt-4.3 is updated daily on Arch.

1 Like