Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.89k stars 323 forks source link

Global histogram and overlay histogram in tone curve tool are out of sync #3016

Closed da-phil closed 8 years ago

da-phil commented 8 years ago

I'm using the latest version from master branch under ubuntu 14.04. I noticed this for quite a while now, everytime I use the curve tool after I made some other adjustments I wonder why the overlay histogram is very different (and wrong) in comparison to the global histogram on the top left, see screenshot below. I guess this should be also fairly easy to reproduce. screenshot from 2015-12-10 23 19 08

Hombre57 commented 8 years ago

This is not an error, the histogram you're seeing in the background of the curve is the one of the image before applying the curve itself, while the top left one is the curve of the final image.

Closing this non issue.

heckflosse commented 8 years ago

The curve histogram shows a different state of tool chain. For example: Play with the Tone Mapping settings (you have tone mapping enabled I saw) and you'll see that curve histogram doesn't change but top left histogram does change. If both histograms would be the same it would make no sense to display both ;-)

Ingo

heckflosse commented 8 years ago

Hombre was faster and explained it better :-)

da-phil commented 8 years ago

I had the impression that the overlay histogram in the tone curves tool was showing the up-to-date histogram some time ago (hence the "bug-report"). Actually now this static overlay histogram is of no use for example when I want to tweak graduations or just do a simple correction of the tone curve for flat images. That's when I need an accurate display of the current histogram. For me it would only make sense to display the current state of the histogram minus the applied tone curve setting, only then you're able to make accurate adjustments in the tone curve when you see the last state of the histogram. In the end this histogram should help to guide you with the adjustments you want to make in the tool, but how is that possible with a histogram which is outdated? This will only work if the only RAW setting you change is the tone curve.

Please correct me if I got the wrong idea about that overlay histogram.

Beep6581 commented 8 years ago

Phil the reason it is the way it is is because it is accurate and useful... once you understand it :) Maybe this screenshot will make things more clear. Neutral + TC1. scrot_2015-12-11 125853

da-phil commented 8 years ago

You gave an example I mentioned above already, the only minimalist example which works with this histogram behaviour, i.e. it only works when the only setting you change is TC1. Imagine you adjust the TC1 (black- and white point) as your first change like you did, but then you also enable tonemapping, increase the contrast, change the colours / whitebalance and then go back to the TC1 because you think also the graduation needs to be adjusted accordingly. How would you be able to do accurate adjustments when the histogram is still stuck in the state of the original RAW file? At this point the original histogram is of no interest anymore.

I guess I know what you're trying to explain though. Of course you're right that the overlay histogram in the TC1 box should not change while adjusting it, that would not make sense, this change should be observable in the global histogram on the top left only, but the overlay histogram should reflect all other changes in settings.

I hope I was able to explain myself better this time ;)

da-phil commented 8 years ago

Ok, now that I had some more time to play around I give you a very simple example where I'm not even changing any exposure related setting to render the static TC1 overlay histogram useless. In this example I only change the DCP camera profile settings.

  1. neutral profile, global histogram and TC1 histogram overlay are the same = > correct screenshot from 2015-12-11 23 21 05
  2. changing camera profile settings: enable "tone curve" and "look table" for proper colour rendering screenshot from 2015-12-11 23 21 33
  3. go back to the TC1 box and notice how the actual histogram and the TC1 overlay histogram show two different histograms. I can't make any precise curves adjustments because the overlay histogram shows me a wrong histogram. screenshot from 2015-12-11 23 21 50

I hope now it's clear what I tried to point out ;)

Beep6581 commented 8 years ago

RawTherapee has a hard-coded toolchain - the tool order and the way the image data flows out of one and into the other is fixed. Assuming there are no bugs, the graph behind the curve shows you the histogram of the data as it flows into that curve. Everything that happens before it should affect that histogram, and everything that happens afterwards should not. Enabling the DCP tone curve implies that the DCP tone curve is applied after the Exposure tool. I can't confirm whether that is the case or whether it is applied before the Exposure tool and the histogram doesn't reflect it. It works correctly for other tool combinations I tried.

These for example show you that the Exposure tool is before the L*a*b* Adjustments tool. With TC1 as in the screenshot, you can be sure that the tools after it will get a fully filled histogram of data. scrot_2015-12-12 030556 scrot_2015-12-12 030608

Unfortunately not all curves have the histogram - that's a case for a feature request.

atorger commented 8 years ago

The DCP tone curve is indeed applied after the exposure tool (and after shadows/highlights, and maybe some more tool, don't remember now exactly where it sits), as the DCP "standard" (as defined by Adobe) mandates that it should be. There's a good reason for that, exposure tool is typically used to correct exposure to make the image suitably bright, and then you want the curve to be applied afterwards.

(With ICC profiles we still apply them in an early stage, which is fine for matrix only profiles, but not so good for LUT profiles with curves embedded. That's not so good but not a prioritized thing to fix as DCP is the main profile format for RT)

Beep6581 commented 8 years ago

Thank you for clarifying that, I'll add it to the docs.

-- Done http://rawpedia.rawtherapee.com/The_Image_Editor_Tab#Eek.21_My_Raw_Photo_Looks_Different_than_the_Camera_JPEG http://rawpedia.rawtherapee.com/Color_Management#Use_DCP.27s_Tone_Curve

Beep6581 commented 8 years ago

How would you be able to do accurate adjustments when the histogram is still stuck in the state of the original RAW file?

Phil, none of the curve background histograms show you the histogram of the raw file. They show you the histogram of the data that flows into that curve at that point in the pipeline.

da-phil commented 8 years ago

@Beep6581 thanks for explaining, well then this behavior makes sense, but I'm still not sure if it's really intuitive, maybe because I'm used to different behavior from other software :D

Also the fact that the effect of the DCP tone curve is not reflected in the TC histograms confuses me. In the end it's a lot of fiddling only with the global histogram to make sure the highlights don't get blown and the shadows don't drown while adjusting the TC although there is already a unusable histogram behind the tone curve.

I made some more tests and I'm surprised that the retinex settings changed the TC overlay histogram too. Does this mean that the retinex tool appears before the TC in the pipeline?

Hmm, this seems to be an interesting problem, I've go give it more thought when I have more time...

Beep6581 commented 8 years ago

I made some more tests and I'm surprised that the retinex settings changed the TC overlay histogram too. Does this mean that the retinex tool appears before the TC in the pipeline?

Exactly. Retinex is a special case, it sits very early in the pipeline, and so to adjust the data that goes into Retinex you must use the "White-point correction" slider in the "Raw" tab, while to adjust the data that goes out of it you can use any of the other usual tools - "Exposure" or "L_a_b* Adjustments".