4 ms·
This is what I do except I use drawImage. You think using getImageData and putImageData is more performant that drawImage(canvas, 0, 0) ? BTW i'm not sure it
by gren 14y ago
This is what I do except I use drawImage.
You think using getImageData and putImageData is more performant that drawImage(canvas, 0, 0) ?
BTW i'm not sure it will works for combining images together with special composite operation.
- leeoniya 14y agodrawImage 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 14y agoThanks!