Well, i got this.. cause in my place they request it like that.. Well i have this: //some variables and coments are a possible code.. But i mean i don\'t know how to do it exact
// constant factors final double GS_RED = 0.299; final double GS_GREEN = 0.587; final double GS_BLUE = 0.114;
Now retrieve each and gett it's red, blue, green component and alpha if exist and multiply them with their corresponding factor.
R = G = B = (int)(GS_RED * R + GS_GREEN * G + GS_BLUE * B);