Color conversion from RGBA to grayscale and back