Conversion to grayscale only if required.