Sigmoid and agx #873
Replies: 13 comments 58 replies
|
Sigmoid is a no-go. AgX might get merged into filmic, but it's not going to be any time soon. |
|
that maybe the theory, in practice i can do things with agx that filmic can not do. |
|
So after some digging, it seems like this is the main difference: a hue preservation adjustment (a slider that goes from no hue preservation to 100%), and more desaturation in the highlights.
Agx also has pre and post tone mapping primary adjustments, which seems overkill and out of scope for a tone mapper. The curve adjustments are different, but I doubt they allow for drastically different results than filmic. The question to me, aside from slight differences in chromaticity preservation strategies, is whether controlling the amount of hue preservation is desirable/belongs in a tone mapping module. My feeling is that you'd be against it @aurelienpierre, but I may be wrong. Idk how predictable those shifts are in practice. |
|
https://github.com/sobotka/Testing_Imagery/blob/main/Sweep_sRGB_Linear_Half_Zip.exr |
|
La visualisation des ces 3 images me suggère que le curseur AGX-contraste à lui seul agit comme l'APN, à savoir augmention simultanée du contraste et de la saturation. AGX Curseur contraste poussée de 3 à 5.jpg Compare and contrast_ Filmic RGB vs AgX - Software _ darktable - discuss.pixls.us.pdf |
|
I'm getting a 404 on the image above |
|
Ok, pushed.
Some findings (TL;DR of the dev docs):
So, in Ansel:
That's 475 more lines of codes into an existing tone-mapper instead of a whole new module of 2843 lines. Overall, I think the crowd just overhyped itself with that new toy, then some youtubers did a couple of good tutorials, and that's it. The whole "primaries" thing is nothing but a channel mixer, that we already have. The rest is very close to filmic without the chroma/color preservation mode. And for the bleached look, color balance already had everything you needed. Results:
So AgX-like default has a more even hue-wise effect than v6 without chrominance preservation (the blue row gets in line with the others), but that comes at the price of desaturating everything a lot more. |
|
I'm about to try the new filmic. After reading your doc:
The opposite may also be true. For the infamous sunsets, pictures of fire, etc. You may want less hue recovery AND less bleaching. In most cases I agree a coupled control is probably what you want. Something to investigate. |
|
I pushed a change that will void previous edits. The problem was the pure AgX (no color preservation) was bleaching valid (non-compressed) colors far too much, so I modified the forward and backward matrices (primaries) to compensate for that alone, even without color preservation on. The matrices have been numerically fitted to minimize hue and chroma deviation across the tone-mapping. It was not the goal, but that actually brings back a larger hue shift toward yellow, which was the initial design criterion of AgX and a request for sunsets. The numerical fit has been done in priority on skin tones and reflective colors (well within sRGB gamut). The updated color preservation removes saturation recovery entirely, as it produced non-smooth gradients in highlights.
Notice how the vectorscope gets back in line as we increase preservation. Sunset: (from https://discuss.pixls.us/t/sunset-scene-with-darktable-rawtherapee/23139)
Portrait: (from my personal collection)
|
|
Ok, new big change pushed, I have a lot of things to say. Recap of previous episodes
Studying AgX methodicallyThe contribution of AgX is to do tone-mapping on individual RGB channels, but in a special color space, where we go by applying a color matrix, and from where we go back by applying another color matrix. The color matrix is the math result of a GUI tool called channel mixer, allowing to define the 9 coefficients of the 3×3 matrix, and that channel mixer can be re-interfaced as a primaries GUI, allowing to define the 9 coefficients from 3 scaling and 3 rotations. Whether we grab the the 9 coefficients from an ICC color profile, from a channel mixer GUI or from a primaries GUI, when that reaches the pixel, it's the same product between a 3×3 matrix and an RGB (3D) pixel. The question becomes: how to build the color space for better channel-wise tone-mapping ? Aka how do we choose the coefficients for the input and output matrices ? My first idea: create a synthetic set of colors, record their initial Ych coordinates, record Ych again after the tone-mapping, and optimize the input matrix that will minimize the hue shift. The output matrix is then the exact inverse of the input. As the first results published here show: that desaturates way too much, even valid colors. In practice, that means non-white (non-Caucasian) people get white skin nevertheless. Kodak went down that path already, never again. So, why not recovering output chroma from input chroma in Ych, same as we do for hue ? Well, because copy-pasting hue is free, but doing the same with chroma/saturation creates non-smooth gradients in highlights, and that's really ugly. So the AgX matrices need to recover saturation for themselves. My second idea: same as before, but in addition of optimizing the input matrix for minimal hue shift, optimize the output matrix too (so it's not the inverse of the input anymore), and optimize for minimal hue shift AND minimal desaturation. Saturation is more critical for us here, because that's the parameter we can't recover directly from input RGB. That's better (previous results), and also restores the yellow drift that people want in their sunsets (whose intensity can be driven by the color preservation parameter), but portraits are a bit weird even when restoring hue: keeping the saturation constant hits Helmholtz-Kohlraush effect and skin, registering near red, appears too bright. Here goes the one-size-fits-all matrix fit. Here, Darktable says "let's give manual control over the input/output matrices to users", which I saw only as a shitty UI giving 12 extra user parameters meant to please the geeks and overwhelm the others, but it actually goes beyond that. See, I had to write 1000 lines of Python for a solver that finds the best matrices minimizing desaturation and hue drift, while not pushing valid Rec2020 colors out of gamut (aka mostly creating negative RGB), and manually ensured that the results were numerically stable (invertible without being overly sensitive to noise). But I'm the color & math guy, it's no problem. Now, giving this responsibilities to the average photographer is only handing them a machine gun to shoot themselves in the foot, because they get 12 parameters that will have dramatic effect on things they don't even know of, let alone understand. (Remember: Blender AgX is a collection of LUT pre-baked by someone who knows). My third idea: given that we can't avoid bleaching, at least control the amount of bleaching we allow, so re-optimize the matrices for minimal hue drift under a pre-determined average desaturation budget. That average is computed on skin tones and reflective colors, aka colors that we know should fit in any RGB space regardless of dynamic range. And that gives us 4 sets of matrices:
Final metrics:
So you get 4 variants of AgX built in Ansel (no/low/high bleach), they are all fitted by numerical optimization under clear constraints, and the Python script to refit them with different priorities or data is on the repository, so the results can be reproduced. ResultsAll results shown with color preservation set at -100% (aka no hue reconstruction at all, pure AgX). Synthetic
Note how the vectorscope gets better radially-aligned as we increase bleaching but also shrinks (chroma scale is identical between screenshots) Portrait
Without bleaching, the lipstick becomes fluorescent. High bleaching also increases the local contrast on the jacket and on the face (reds), but we start loosing the skin saturation too much. Low or medium bleachings are excellent compromises. Sunset
As expected, high bleach restores the radiometrically-correct red in the sunset while washing colors a bit too much for my taste. Pick your poison. ConclusionForum democracy is when the Open-Source world deludes itself into thinking that more clueless opinions amounts to collective intelligence if you add enough of them. There is really nothing to salvage in Darktable. |
|
One more thing @aurelienpierre . People have been playing with sunsets and agx in the chat. This is a crop from @Jiyone 's edit. He says this not so smooth area around the sun is the result of filmic gamut mapping (soft clipping) to sRGB.
He then shared the same image, but in Adobe RGB.
The second one looks clearly better. Given that my screen only displays sRGB, I'm assuming that at some stage (element app, browser, etc.) there's some perceptual intent going on. Wouldn't something like that make sense for filmic, particularly for exporting to smaller gamut sizes? At the expense of overall saturation, but in favor of smoother gradients.
|








































Uh oh!
There was an error while loading. Please reload this page.
I love the redesign of darktable to ansel. It looks much better and has much better performance.
One thing i am missing and that might stop me from using Ansel is the fact that it has no Sigmoid and/or AGX.
I use those 2 all the time in darktable.
All reactions