Tone Equalizer - Understanding the mask histogram in advanced tab

Continuing the discussion from Tone equalizer vs tone curves:

I use the tone equalizer a lot and find its results to be fantastic much of the time. But something that still baffles me sometimes is the masking, especially when the colour pickers for exposure comp and contrast don’t help.
(tagging @obe who also claims to have this issue frequently)

Based on the manual and Aurélien’s videos, our goal is to stretch the grey bar under mask post-processing to fill the space as much as possible. This should make the mask cover as much of the tonal range as possible. It makes sense and often works as expected. But sometimes we get a very flat histogram in the advanced tab.
Why is this? What is the histogram showing when this happens?

Here are examples of a bad mask and good mask:

Bad mask:


image
image

Good mask


image
image

Based on the image with mask display turned on, it’s clear that the good mask in the second example is superior, there is more blurring and greater separation of tones. This is reflected in the histogram in the advanced tab. But, the grey bar in the masking tab is very much bunched up towards the highlights, which would make you think your mask was not good.

In the bad mask, the grey bar in the masking tab would seem to indicate you have good spread over the tonal range, which is obviously not the case from the image and from the histogram.

So, my question is not how to get a good mask, but rather trying to understand what is happening between the grey bar and histogram. The bad mask is very contrasty, with large areas of highlights and shadows, so I would expect the histogram (which I know is the mask, not the image) to show two peaks, one at the left for the shadows and one at the right for the highlights. This would still be a bad mask because it ignores midtones, but it would at least make sense with the masked image. But instead, the histogram just shows a slight bump in the highlights region.
And conversely, in the good mask, why is the grey bar under mask post-processing bunched up and not reflecting the decent spread of tones?

6 Likes

Hi’ @europlatus
Thank you for a very good example and explanation. I totally agree…

I would say the second example needs additional attention due to the highlights that are bunched up at the right side of the historgram, and I would adjust the mask exposure compensation to fit the entire curve into the range

Where I have problems is using the mask contrast control to expand or contract the curve, which often causes the histogram to shift in unpredictable ways. As I understand things, it’s part of the nature of the controls so I just deal with it.

Lately I’ve simply adjusted the mask exposure compensation by clicking the color picker, and that’s usually good enough for me to make my adjustments without bothering with mask contrast.

Sure, the mask isn’t perfect and it can be improved.
But often, trying to adjust the mask exposure compensation to stop the bunching up results in the 1st example of a flat histogram and bad mask. This is the struggle. For some images, there seems to be a very narrow “margin of error” and it doesn’t always fit with what you might expect in terms of distributing the grey bar.

I’m sure there’s a mathematical reason why this happens, and I guess I don’t really need to know the maths behind it. But from a usability perspective, I want a better understanding of how it works because it can often mean that you’re constantly switching back and forth between the Advanced and Masking tabs to get it right.

The gray bar and the histogram have the same X axis of -8 to 0 EV. The gray bar shows the EV range that contains the middle 80% of the EV range, so the darkest 10% and brightest 10% of pixels are excluded. From a quick review of the code it looks like the white bar in the middle of the gray bar that is supposed to be the average is always placed in the exact center of the gray bar. This could be misleading because it doesn’t indicate that the distribution of that middle 80% might be lopsided. If it were implemented as the median instead, then in that first example it would be much closer to the right side of the gray bar than the center.

For the second example almost all of the pixels are in the -8 to 0 EV range so fit within the histogram, except for a small amount of highlights > 0 resulting in that small spike on the right side of the histogram. And it looks like there’s nothing at all below -5 EV.

But for the first example, there is a significant number of shadow pixels darker than -8 EV. All pixels darker than -8 end up in the same first histogram bin, so when the Y axis is scaled to accommodate that large bin, the rest of the histogram ends up looking relatively flatter. There is also a long tail of values spread all across the left side of the histogram. The left side of the gray bar is placed at the exact point where 10% of the pixels are darker and 90% are lighter, and in this case that point ended up somewhere in the middle of that long tail.

4 Likes

Due to the recent posts, I think I now have a somewhat better understanding on what is going on. A better understanding but the conclusion seems to be:

The grey bar under “mask post processing” and the histogram put together does not give a satisfying understanding of how you should adjust the sliders to obtain a good result.

Use of the mask contrast compensation slider leads to unpredictable results. A small change can lead to massive changes in the grey bar and the histogram. . I have also noted that the presets doesn’t use contrast compensation, so maybe we should just disregard this slider? Or could the contrast compensation be changed to work more “smoothly”?

In the end you want to make sure the mask is isolating the different regions of the image that you want to adjust. The histogram and the grey bar give you some indication of where the control points sit relative to the distribution of tones in the image, but the final decider is to make the mask visible, see what regions it isolates out, and work out whether it allows you to tweak the specific parts of the image that you want to tweak. To acheive that you have the exposure and contrast compensation, the blurs, and the various guided filter modes to overall come up with a mask that suits your purpose.

3 Likes

I’ve opened an issue, as there seems to be a problem with the colour pickers.

(Open the GIF in full screen to better see what’s going on.)

1 Like

I feel this module is perhaps a case where the histogram is essential rather than just a guide (like the main histogram window). Judging the mask based solely on what it looks like (i.e. trusting your eyes) can be difficult in my experience, especially when dealing with greyscale and blurriness. Only the histogram shows you precisely where the tone curve points lie relative to the mask.

I have used the Tone Equalizer a lot over the last year and have got much better at making masks, but there are still cases where it looks good with the visible mask, but the histogram shows that the control points are not exactly where you want them.

So, from a usability perspective, would it make sense to have a histogram replace the grey bar on the masking tab? I don’t feel that the grey bar is a reliable enough guide. The visible mask and histogram are the two essential tools for creating the mask, so having these two visual guides plus the control sliders on the same tab would improve the user experience in my opinion. Thoughts?

2 Likes

@paolod Thanks for the explanation. This helps a lot with understanding what’s going on.

@kofa Thanks for submitting this. Good to see on Github that there’s already a fix in the works. I had definitely found issues with the pickers but hadn’t got around to identifying exactly what was going on. But I had noticed that clicking the pickers repeatedly was cycling through different values and not working as expected. They were also working like on/off toggles rather than single operations.

I don’t pay much attention to the histogram at all, except maybe to get an initial gross setting for the mask. I then look for how the mask clusters together regions of the image adjusting the mask parameters accordingly, and I mouse over those regions to see what is the intensity of the mask. From that EV value, I can predict which control point is closest to that level, and see whether the mask needs further setup. To adjust the level in that region, I then turn off the mask, however over the desired region and us the mouse wheel to adjust.

I’ll have to go back and watch the Dodge and Burn video to get a better handle on the masks. I have played with them a bit but I am far from controlling them precisely. The drastically different results with all the norms and guided vs average vs none…leave me without a clear strategy to apply the mask before even getting to edges/smoothing exposure and contrast adjustments…so 9 times out of 10 I tweak a preset or use the simple tone curve and mouse over with little interaction with the mask…If anyone wants to share an image and xmp where they have made some considerable changes from the defaults it might be nice to examine your approach to tweaking the mask…

1 Like

A bit of padding on the x axis to the right of 0 and the left of -8EV to allow a small border at each end would better allow you to see these spikes outside the DR of the TE…

That is a good video. However, it doesn’t cover the newer exposure-independent guided filter (eigf) [EDIT: actually, from memory, I think the video mentions the problem of shadow treament, and says that a solution is still to come – that solution eventually turned out to be the eigf]. That one results in a more even distribution of the mask across the tonal range. It is sometimes still appropriate to use the original guided filter though, which tends to treat the shadows more uniformly rather that selecting out specific details for treatment.

I’d be interested to see a demonstration of your technique to see if this is the ideal way to go. From your description, I’m not sure it sounds any easier than just nailing the histogram from the start. I know if I can get something like this…

image

… then I have control over the whole tonal range.

Having said that, learning how to use the displayed mask better is also crucial, I agree, especially for using some of the other controls like smoothing and edges refinement.

Do you really need that all the time? Quite often, I only need to modify part of the range, so why worry about the rest?

Good point, but I often do want the whole range, yes. As well as dodging and burning in the whole image, I sometimes use Tone Equalizer as my primary tone curve instead of any others, including Filmic. I know this is perhaps a non-standard way of using it, but it sometimes suits my specific purposes.

I just want to reiterate at this point that I’m very happy with the functionality of the TE. But it is a fiddly module to use and I’m wondering if it could be a little less so with some UI changes, like merging the advanced and masking tabs, for example. I get the sense that I’m not the only one. But I appreciate this may not be a priority for the developers.

That’s actually a good question…it is the way I often use it…looking at the histogram above if you wanted fine control in say the highlights would you not spread what is currently 0-4 over 0-8 and then do the same for the dark stuff with a different instance…I haven’t strayed far from modifying presets as I said earlier but maybe its time to experiment a bit…

I just filed a github PR (#10014) which should improve TE auto pickers estimations so to get quickly a good mask.
I would like to hear your feedback on it.
Please handle it with care, use a separate test environment and it is just a work in progress and it might break old edits.

Also (#9998) that will improve the behaviors of pickers in the gui, approved but not yet merged.

2 Likes

Overall the contrast slider and the auto picker behave really well IMO, it is super easy to nail a mask with covers all correction nodes and TE becomes a joy to use.

Well this sounds great. I’m on Windows and doing the Windows Insider Program by @wpferguson, so I assume I won’t be able to test it until it gets a proper merge, but I’m excited to see what happens with this PR.

1 Like