improve rendering performance by precalculating grayscale LUT
Merge remote-tracking branch 'upstream/master'