It depends on what you're doing it for, but if you plan on scrolling around a 5000px5000px image I would definitely break it up into sections or tiles and use drawImage
to only draw the parts the user will see.
For drawing large images you will see a performance decrease using putImageData
its what drawImage
is there for. putImageData
is amazing when doing anything with particles, etc. Basically when you are drawing lots of small pieces to the screen you can easily draw 100,000 objects using putImageData
.
Performance and memory usage shouldn't be a problem if you are only drawing the sections the user can see, heck even the full 5000x5000 shouldnt be too much of an issue honestly. What you're doing is not uncommon at all most browsers should be able to handle it.
Here is a poor unfinished example I was working on for a previous employer the example uses a ton of tiles, even implements collisions and pathfinding and runs fine. If I were to just draw out one big map image it would be around 10000x10000 if I remember correctly (each tile is 64x64)