HSVL info incorrect in Viewport window?

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

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

1 Like

Ok thanks I went ahead and filed a bug report

We are using the same HSVL values Nuke used until Nuke 8, where V was computed from R’G’B’ (sRGB) values, see Index

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.

1 Like

Issue HSVL : V reporting incorrect data in the viewer? · Issue #286 · NatronGitHub/Natron · GitHub fixed by Viewer info line: compute HSV from linear RGB · NatronGitHub/Natron@9d43b4b · GitHub

1 Like

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)

1 Like