HSVL info incorrect in Viewport window?


(Troy) #1

Hey guys,

I noticed something strange recently in the viewport information for the HSVL data that is printed out when Ctrl+LMB sampling from a pixel, the L and V seem to be swapped?

For example if I just sample a solid color of RGB(.18116, .18116, .18116) what is returned to me in the viewport for HSVL ( 0.0, 0.0, 0.46, 0.18116), as far as I understand the L data seems to be returning what the V should be returning. V being the value and to my knowledge the largest value from the RGB data.

I was going to create a bug, but wanted to get a sanity check before I do. Thanks


(Ingo Weyrich) #2

afaik L = (min(r,g,b) + max(r,g,b)) / 2. If r==g==b => L = r, so at least L = .18116 seems to be correct for the case that r = g = b = .18116

Edit: V should also be .18116 in this case IMHO


(Troy) #3

Ok thanks I went ahead and filed a bug report


(Frédéric Devernay) #4

We are using the same HSVL values Nuke used until Nuke 8, where V was computed from R’G’B’ (sRGB) values, see https://community.foundry.com/discuss/topic/100271

In Nuke 9 they switched to V = max(R,G,B). I’ll adjust that in the code
L stands for luminance, computed with rec709 coefficients.


(Frédéric Devernay) #5

Issue https://github.com/NatronGitHub/Natron/issues/286 fixed by https://github.com/NatronGitHub/Natron/commit/9d43b4b514497f918c2c4b26d30b811d3f1bc4a9


(Frédéric Devernay) #6

L is luminance and should be computed using luminance coefficients.
See http://www.icst.pku.edu.cn/F/course/ImageProcessing/2018/resource/Color78.pdf (or https://doi.org/10.1145/800248.807361 if you have an ACM library subscription)