Result of html5 Canvas getImageData or toDataURL - Which takes up more memory?

Viewed 8808

Part of my app includes html5 photo editing using a mixture of standard 2d context canvases and webGL.

Anyway, I am saving 'undo' states while the user is manipulating their photo. These are all stored in a Javascript object as base64 image data.

Everything works fine and performance is good.

However I am wondering if storing the data from getImageData might take up less memory or offer better performance?

So to summarise my question is:

Which takes more space in memory, a base64 jpeg generated by toDataURL() or the result of getImageData()? And are there any performance differences between the two (with regards to loading onto a canvas, and pulling the data off of a canvas)

Thanks in advance.

3 Answers
Related