Encode the contents of a canvas element in ESC/POS format and transmit it to a thermal printer, all through the browser.
Warning: Canvas content must have been prepared for this, where the RGB code of all pixels must equal 0 and the only variation between them must be in opacity, with black pixels having opacity 255 and white pixels having opacity 0.