HTML5 Canvas Drawing with Bitwise Patterns