Hi Olivier!



 Olivier-CR:

is there a risk of 2 RGB pixel being assigned the same grayscale value


Yes, the risk is real, and such an occurrence is in fact quite likely:  See the
so-called “birthday paradox.”
If the person who prepared the segmentation masks were kind, then he
could have purposely chosen RGB values that map to distinct grayscale
values.  (And if he were diabolical, he could have chosen 55 RGB values
that all map to the same grayscale value.)  But if the RGB values were
chosen somewhat “randomly,” then you will likely have such a collision.
So …   Do you feel lucky?
Best.
K. Frank