Can I pass a JavaScript byte array to glTexImage2D?

I intend to continuously generate images in memory, then send them to glTexImage2D.

Is it possible to send JavaScript arrays directly? Because all the WebGL examples I saw are using HTML Image objects. That’s not what I need.

Also, some people suggested the use of the Canvas object, but seems that Canvas is slow. Since I already have all the pixels in an array, do I really need a Canvas as mediator?

I cannot give you an exact how to however I know it is possible to create image objects from byte arrays.