Rewrote intensityToChar to use a look-up table