Search the internet for the word 'grayscale'. One of the first hits should be the corresponding wikipedia page, which has the equation for weighting each RGB component to get the corresponding...