I have two <canvas>
elements in a document.
I want to draw a shape on canvas1, use the ctx1.getImageData()
method to copy parts of that shape and animate these parts on canvas2.
I read that using ctx2.putImageData()
is slower than using ctx2.drawImage()
.
How can i create an Image
object from a CanvasPixelArray
(which is returned from the ctx1.getImageData()
call) in JavaScript?
(Note: I don't want to copy the whole canvas1 but only parts of it. Also, I don't care about old browsers)