improve rendering performance by precalculating grayscale LUT