Implemented templated functions for 8bpp vs 32bpp rendering.