I have a game where you can draw pixels on the screen, like a simple pixel paint program. I want to make it so the player can export their created artwork.
A couple of possible solutions I can think of:
* Export the image using browser invoke download and use base64 image data. The problem with this is I don't know how to convert pixels (or pixel data, could be an array representing pixels) on the screen to base64 data.
* Capture a snapshot. However the problem with this is I think the image size ratio would have to match the game viewport, because you can only take a screenshot of the entire viewport :(
Any ideas?