You proceed from the assumption that using a sprite somewhere on the page actually requires a copy of the sprite piece in memory. This is not quite true.
How drawing works (at least in Windows, on fingers):
- Under the program window (browser), a large rectangle is allocated in the video card's memory.
- For some events, a part of this rectangle is marked as “to be redrawn” —for example
- over the program window someone stretched out another window
- the program was expanded or turned off
- the program code itself decided that some part of the window was outdated and had to be redrawn - for example, the DOM changed in the case of the browser
- This raises a window redraw event (or part of it).
- The redraw handler decides what the redrawed part looks like, and re-renders it into a rectangle in the video card's memory.
How does the browser handle sprites?
If at the moment of redrawing the element using the sprite got into the area being redrawn - the necessary piece of the sprite is copied into the same rectangle in the video memory. When drawing it rotates / scales / trimmed to the size of the element being redrawn.
A copy of the sprite is not created (or is created temporarily) - a straight-edge is already selected for a long time, and it no longer draws the drawing of the sprite. Those. The moment to "create a picture" from the sprite, which you are so afraid of, does not come - just a piece of the sprite is copied into the already allocated buffer in memory.