Blender AgX in darktable (proof of concept)

You’re welcome, but don’t credit me for too much, it was copy-paste work on stuff I understand little about.

You can try the AppImage now (download it, make it executable, double-click or invoke on the command-line to run). But please do not expect it to give the same results as Blender.

Wow!!

Handles the difficult lighting situations perfectly without having to adjust anything!

Here is a comparison of Sigmoid smooth preset on the left and AgX on the right:

With the Sigmoid I had to increase the blue attenuation to achieve a smooth gradient falloff in blue lights. In AgX I only had to increase the contrasts with slope and power.

Nevertheless, I think the primaries sliders, as in Sigmoid, could also be very useful in AgX. In this example I would have lowered the saturation of the blue channel in highlights a little.

I also miss the gamut/tonemapping protection for sRGB in AgX.

I’ll keep playing and will get on your nerves with reports.

In any case, good work @kofa ! :tophat:

8 Likes

The gamut protection is something I’d like to port from AgX_LUT_Gen/AgXBaseRec2020.py at main · EaryChow/AgX_LUT_Gen · GitHub (I think that is what the ‘guard rail’ is, as explained by @flannelhead).

The mixing (hue restoration) is also possible, the Python implementation in that repo uses a fixed 40%, but they generate a LUT, so we can easily turn that into a slider. The same goes for the rotation and inset, I can try and replace the fixed matrix with a calculated one. I won’t have time tomorrow, and not much on Thursday, but I’ll try to do something during the weekend. If I achieve something, I’ll add a new AppImage.

More likely, though, I’ll have questions. @flannelhead , will you be around? (Sorry.)

3 Likes

Please do not rush! I have to test it out as it is now in its “pure” form. :wink:

1 Like

Hello,

It works for me too on a Debian 12, I won’t have time to play with it before this weekend.
despite being a sigmoid fan, I’m impressed by the first results.
Here’s the setting I used for these first tests,

Congratulations, there’s definitely something there!
Best regards,
Christian

1 Like

The roll off into what is obviously the clipped part of the highlights in AgX is really nice!

I think this needs to become another tone mapper module!

7 Likes

Not only that. What I’ve tested so far is that I could master a photo with any dynamic range using only the exposure module, these four sliders in AgX and eventually color balance RGB (only for saturation). This is unbelievable:

14 Likes

Wow… @kofa your in deep now :slight_smile:

I made one attempt to try and build it for Windows…it wouldn’t build…but likely due to my lack of Git’s-man-ship :slight_smile:

I tried this and then to build but likely I have missed something…

image

Git clone kofa repo and then checkout his branch.

1 Like

Thanks I just tried it on one of the playraw images… really nice results with little to no effort…

Thanks for the git tips…I thought I could somehow work with a remote branch and not clone the whole thing and maybe its possible but this works…I was worried… there was a long string of errors in the build about access and a lock on some external process but the build completed and it seems to work…thanks very much…

1 Like

I’m only looking on my phone so not ideal, but the main diference looks to be that sigmoid rolls the blue into white, whereas agx twists it to cyan. Orange lights and skin tones also seem a little brighter with agx.

I wonder how it handles the salmon look of fire and flowers?

Would this be a separate module, or part of agx? Would love to see a separate gamut mapping module in darktable.

Congrats on the work.

Is left image sigmoid and right image AgX (as in your earlier concert sample)? How would sigmoid have handled that dynamic range if you had just increased the exposure?

No, this is the raw file without modification vs. AgX with increased exposure

Here is Sigmoid (left) vs. AgX (right) in their default settings, both with the same (increased) exposure:

I can reduce the contrast on Sigmoid (right) and then it looks similar to AgX with default settings (left):

With slope, power and offset functions you can still increase the contrasts in AgX without losing the details in highlights (overexposing them). Sigmoid with reduced contrast as above (left) and AgX with increased contrast (right):

So far I have noticed the following:
Agx has much greater flexibility in terms of contrast distribution. This means that you can achieve a good result immediately without having to access the other modules, almost regardless of the dynamic range of the photo (of course, if you have first adjusted the exposure with the exposure module).

The saturation can also be adjusted immediately.

However, with its skew slider, Sigmoid scores in some scenes where you need a lot of contrast in highlights.

But I have to play a lot more to be able to make better conclusions.

6 Likes

@kofa, can you explain why this happens, ie how the mapping in AgX is different from sigmoid? How are they different? (Just curious)

I think it boils down to having slightly different parameters, slightly different curve, different method of handling negative RGB values at the input (AgX just simply clips to zero).

When I get the time, I could try to get as close a match between the modules as possible. I think I have a script laying around somewhere to fit the curve parameters and the primaries settings etc.

Both modules are essentially:

  1. Handle negative RGB
  2. Apply inset matrix
  3. Per-channel curves
  4. Apply outset matrix
5 Likes

Yes, ask away, I’ll be happy to reply but not always quick to do so. :slight_smile: Please bear with me.

2 Likes

Windows installer (I tried to follow the instructions for a ‘generic’ build, hopefully it’s OK):
http://tech.kovacs-telekes.org/dt-agx/darktable-3.9.0%2B10184~gb37c3e25e2-win64.exe

3 Likes

After a short test I have to say this Blender AgX is rubbish.

Why? Because it seems that I have to build a new starting point hopefully in near future. :innocent:

I was never a friend of filmic. I found it way too complex. I never knew what to do, to achieve what I want, so it was more or less playing around with the settings to get what I want. Therefore, I often just used tone curve, without a tone mapper.

This changed when sigmoid came. Sigmoid brought a lot of comfort for me. It is quite easy to handle and the results are predictable. Anyway, I was never completely lucky with the colour handling and the contrasts in the highlights. The highlights somehow often looked a bit dimmed and unnatural. I often had to do further work with other modules to get them the way I want.

Your copy and pasting (don’t make this effort smaller than it is :heart_eyes:) @kofa seem to bring a further big step. The highlights now look really natural to me, I just tested it with a few pics, but the results are more than convincing!!!

It could be that I use your appimage as my standard version until your work reaches the stable branch.

THANK YOU for your work. And not only to you but to all developers who are making darktable what it is. :heart:

10 Likes