Jz masking channel...dumb question....

So as part of some messing around prompted by a recent question about 18% grey I thought well using a colorchecker image and masking it would be a good example…

Masking with the gray channel seemed to behave much as expected… ie the patch at 50% L in LAB picker values was about 0.18 in the mask picker and the other patches seemed okay…

Then I tried the perceptual channel Jz… and found that it gave values greater than 1 and outside what could then be selected in the UI… (unless you use mask boost)

The creep started at the third patch from the left with L value of ~50…it was .6 the next patch was 0.9 and then 1.25 and then 1.65 for white. I suppose this somehow reflects how white is referenced with Jz??.

In any case I tried to make it simple but might be overlooking something … I basically disabled everything. I used standard wb to wb off the gray patch. and then used two exposure instances…the first one to tweak the exposure to get the white patch to ~96 and black to around 16 which is spec for those patches (values shown under color picker). Then I just used the second instance to play with the parametric masking of “midtones”…

If you were to simply make a mask of around 0.5 using the JZ channel it would clearly not mask that and much of the range that is brighter than L-50 can’t be masked in 0-1… If you use the mask boost then the upper value in Jz goes up to like 8 or something and then you can now mask the point but there is no numerical link (midpoint) really at that point to the tonal range…

All the mask sliders at 1…

Adding the boost by 1 ev brings it to where it can be selected…

image

Adding a massive number beyond the soft limit might give something like this…

image

I’m off to read the manual which is likely what I should have done first but I just thought I would throw this out here in case others were using the Jz channel and might have a better or maybe as simple a view as I had of it…

I have been out of the loop for a while, but I would say it is possible for values to exceed 1 in the case of HDR, which your raw file probably is not. Now, I do not know the mechanics of masking in dt, so I cannot answer that part.

I sort of get it if I just had the image opened and had not changed exposure at all… But the mask is done in the second instance of exposure after adjusting the white patch to L=96 in the first instance… I would have thought then the second instance would mask based on that but it again must be how the data are referenced when selecting Jz as the mask channel… For sure it can access data outside 1 and you can tweak the UI with the mask boost to be able to mask that I am just trying to understand what happens from instance 1 to two…

From what I understand, Jz is a perceptually linear mapping of an absolute luminosity range of 0..10 000 cd/m² on a range of 0..1 (https://im.snibgo.com/jzazbz.htm and articles cited there).
Darktable still works in LDR, where display “1” more or less corresponds to the reflectivity of white paper, or in any case nowhere near those 10 000 cd/m². So I’d expect Jz values for reflective surfaces to be (very) low.

Thanks I read through that and it makes perfect sense except when I look at this value of 1.65 for L=96 patch in DT…what is the 1.65?? Values calculated in the test images of your reference for Jz were as you say fairly low…

Perhaps it is a clamping issue, that 1.65 should have been cut off at 1. Often, it is just the way the math settles when the values are manipulated, or there is a bug in the code or order of operations. At least it is not a NaN or Inf number. :slight_smile:

According to Online Color Converter - Colormath, Lab(60, 0, 0) is JzAzBz(0.01651, 0, 0), so it looks like a scaling by 100.
Lab(50, 0, 0) is JzAzBz(0.00596, -0.00001, -0.00001), which could be scaled + rounded to 0.6, as mentioned in the original post.

Ya I figured it was something about the colorspace luma I just didn’t do any math… checking 96 L in LAB …makes sense why I saw 1.65

image

Adding 1 EV in the mask boost sets the range to 2 and each ev doubles it so 4, 8, 16 etc… If L=70 is about 1.0 for Jz then all sliders in the mask full to the right by default mask >70% L in Lab… it almost seems like a sensible range might be 0-2 as a starting point to allow to be more selective in highlights?? Of course this will change image to image and esp for some very HDR images.

image

filmic normally sets a white level around 4.5 EV based on exposure (on most of my shots, anyway). It seems to me it uses the max RGB values (unbounded, scene-referred values) to find that number. L = 100 is diffuse white (that’s ~2.5 EV above 18% grey, since log2(0.18) = -2.47). Light sources and specular reflections are brighter than that.