darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.77k stars 1.14k forks source link

Histogram in new 'rgb levels' iop #3364

Closed leclercj closed 4 years ago

leclercj commented 5 years ago

Describe the bug As a user, I do not understand why the histogram in "rgb levels" iop does not have the same horizontal scale than the overview histogram at top right darkroom corner.

To Reproduce Steps to reproduce the behaviour:

  1. Go to 'darkroom'
  2. Activate the new 'rgb levels' iop and make it the last one applied in the pipeline. No other iop activated after. Keep the default 'rgb levels' iop parameters. Should not change anything to the image
  3. Compare the histogram in 'rgb levels' with histogram on top right corner.
  4. As 'rgb levels' is the last iop applied and not not modify the picture, I'm expecting both histograms to be the same. Actually, the 'rgb levels' appears shifted to the left compared to the main one.

Expected behavior I'm expecting consistency between histograms. Same horizontal scale.

Screenshots 'rgb level' histogram

Capture d’écran du 2019-11-10 12-30-44

Platform (please complete the following information):

Additional context legacy 'level' histogram for comparison. This one is well aligned on x scale with main histogram

Capture d’écran du 2019-11-10 12-33-04

aurelienpierre commented 5 years ago

https://discuss.pixls.us/t/why-is-the-global-histogram-in-darktable-different-from-the-ones-in-modules/14794?u=aurelienpierre

leclercj commented 5 years ago

Thanks @aurelienpierre for you explanations. It helps, but I still have one question

I do not have problem with the histograms as displayed within "Lab" iops ('levels' and 'tone curve').

Also, with these 2 operations working in Lab space, I can easily see the correlation between the histogram in L channel and the RGB top histogram. x-scale appear the same.

'rgb levels' and 'rgb curves' are both working on linear RGB space, right ? So why are the embedded histogram different ?

Capture d’écran du 2019-11-11 23-18-27

junkyardsparkle commented 5 years ago

If you disable the "compensate middle gray" checkbox in 'rgb curve', it will have similar histogram to 'rgb levels', and if you set histogram profile to linear Rec2020 (or whatever working profile is), the top histogram will match those, too.

leclercj commented 5 years ago

Thanks @junkyardsparkle. This "compensate middle gray" checkbox is exactly what I see missing in 'rgb levels'. Don't you think it would also make sense in 'rgb levels' case ?

junkyardsparkle commented 5 years ago

Don't you think it would also make sense in 'rgb levels' case ?

I personally don't use it, and would prefer that it wasn't enabled by default, but for consistency it would make sense for it to be available in both modules, I guess... it's not up to me, though.

leclercj commented 5 years ago

Then I would also question the definition of 'medium grey point' in 'rgb levels' and this won't be any more just a graphical representation topic. My view is that it would be better to use as 'medium grey point' the mid point from the "grey compensated" scale.

aurelienpierre commented 5 years ago

The middle grey compensation is only a non-linear transform to push the 18.45% grey to 50% and then center it on the graph. I have mixed feelings about that, but levels and curves are tools of the past to me.

leclercj commented 5 years ago

The middle grey compensation is only a non-linear transform to push the 18.45% grey to 50% and then center it on the graph

If it make sense for 'rgb curve' to push the 18.45% grey at center of the graph, shouldn't it be the same for 'rgb levels' ? The mid-grey slider in 'rgb levels' could also be attached to this 18.45% grey.

levels and curves are tools of the past to me.

However, 'rgb levels' and 'rgb curves' are new tools coming with dt3.0. Don't we have a contradiction here ? By what do you replace them ? all filmic ?

aurelienpierre commented 5 years ago

If it make sense for 'rgb curve' to push the 18.45% grey at center of the graph, shouldn't it be the same for 'rgb levels' ? The mid-grey slider in 'rgb levels' could also be attached to this 18.45% grey.

It's less important for levels since the controls are sliding in 1D, but setting up nodes in 2D on a linearly-encoded graph can be tricky for low-lights (hence the log scaling in the Lab tonecurve, that wasn't ported to the RGB one).

By what do you replace them ? all filmic ?

What rgb levels do is exactly the same as the colour balance (using only the lightness sliders): the grey is a power function, the white is an exposure compensation aka the slope, and the black is an offset. The colour balance having the benefit of not being bounded to [0; 100] % (because the levels ergonomics are grounded into the display-referred workflow) and giving a more precise and reproducible setting.

Same applies (to some extent) to the tone curve (still inheriting its ergonomics from the display-referred workflow), with the difference that the curve could be bent to more specific things that the colour balance slope/offset/power, but is that really useful in practice ? If it is, you have the tone equalizer : once you remove the details preservation mode, it's a simple chroma-preserving tone curve, but with log-scaled controls and 1D sliders than can be set more accurately than 2D nodes on a bounded graph. Same feature, better ergonomics.

However, 'rgb levels' and 'rgb curves' are new tools coming with dt3.0. Don't we have a contradiction here ?

There is what I say, and there is what we decide. My opinion is exposure + colour balance + filmic replace (feature-wise) half the modules in darktable with better results. You only need denoise profiled, local contrast, lens correction and maybe defringe to get your full pipeline, plus tone equalizer for cases where filmic is not enough. But not everyone agrees and people stay attached to their old tools.

junkyardsparkle commented 5 years ago

Same applies (to some extent) to the tone curve (still inheriting its ergonomics from the display-referred workflow), with the difference that the curve could be bent to more specific things that the colour balance slope/offset/power, but is that really useful in practice ?

I understand where you're coming from, and I'm coming to feel the same way as far as the specific case of straightforward processing of RAW files resulting from "normal" photography... but I think it's important not to be too dismissive of other use cases, or the tools that might be useful to them. Consider somebody scanning old color negatives, for instance (maybe with a camera rather than a film scanner); independent RGB curves are pretty useful here. :-)

vsz1lu commented 4 years ago

@junkyardsparkle

Consider somebody scanning old color negatives, for instance (maybe with a camera rather than a film scanner); independent RGB curves are pretty useful here. :-)

Exactly! But not just 'old' negs ;)

The digital post-processing of chromogenic films is a really hard work - especially with under/overdeveloped or push processed stuffs what have strong colour shifts. The dynamics range of modern analogue materials (expect colour reversal films) is more-more wider and the colours are working in total different way. In the digital world you just try to reach some tonality what you can see on enlarged chemical prints or properly(!) developed slides in projection / ciba print. And don't know what is surrealism while not see badly developed slides :)

The 'rgb leves' and 'rgb curves' is a very-very great feature in DT! I must processing my raw colour scans frame by frame with GIMP in the last years. But now I can rethink and move my colour post-process workflow (except the dirt removal of course) to darktable, what is more effective way with full rolls what I shot of some subject and in some lightning conditions. The 'compensate middle gray' switch is unbelievable useful stuff: I can easily switch between average ranges and highlites while editing the curves. It's simply brilliant. Don't forget: logarithmic scale is perfect for digital images where the low and mid lights area is very important, but the soul of film negatives is living in the highlites! Looks like the midgray checker of 'rgb leves' useless for colour negs - it's push the most part of image over ~Zone IIIV when click a on an area what metered to Zone V, but maybe I use not perfect sample.

So many thanks for the RGB Curves, my life gone to better! I'll order new stock colour poisons and some roll of Ektar :)

github-actions[bot] commented 4 years ago

Stale issue message