Solved by KFrank in post #2 
              
              
                Hi Olivier! 

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 diabolic…