added upoptimized checks for color conversion