I am doing a shapediver definition, in which basically from an input image I would like to get the grayscale at locations. The ShapeDiverImageSampler component, returns colors in RGB format.
I am then wondering how to convert these colors in grayscale. I am thinking about splitting the returned list into a tree such that each branch (corresponding to a pixel) contains three items (R, G and B) and then use a formula (like L = 0.2125R + 0.7152G + 0.00722B) to convert the colors into grayscale. But as any shapediver definition should be optimized for speed, I am wonder if there is a faster way.
Thanks in advance.