I want to create a new ImageData object in code. If I have a Uint8ClampedArray out of which I want to make an image object, what is the best way to do it?
Uint8ClampedArray
There is the createImageData() method. But for this you need the context of an existing canvas.
createImageData()
var myImageData = context.createImageData(cssWidth, cssHeight);
See here for more information.