Sorry, but I don't quite get what you are trying to achieve. You only need server-side (e.g. Node.js) code if your application requires image processing in the back-end.
Drawing pixels on the canvas in the browser requires careful handling of different RGB types and endianness. Please see the
Image.toImageData() function. I'd however recommend using
<img> instead. The cookbook recipe you are referring to uses
toImageData(). Please let me know if that solves your problem.