3 ms·
drawImage is usually faster. i think it's also more useful if you need alpha composition (overlays). http://jsperf.com/canvas-drawimage-vs-putimagedata/11 http
by leeoniya 15y ago
drawImage is usually faster. i think it's also more useful if you need alpha composition (overlays).
http://jsperf.com/canvas-drawimage-vs-putimagedata/11 http://jsperf.com/canvas-drawimage-vs-putimagedata/11
also read this about imageData caching and explanations of the different opts. loop unrolling helps a bit, forget the typed array stuff for now, it wont work anywhere for some time.
http://hacks.mozilla.org/2011/12/faster-canvas-pixel-manipulation-with-typed-arrays/ http://hacks.mozilla.org/2011/12/faster-canvas-pixel-manipul...
- gren 15y agoThanks!