I’d be curious to see if you could convert svg to another format on the fly faster than the browser does. From my layman perspective that behavior sounds like initializing a bitmap to a max size and then parsing the svg into it.
I don't know about any bitmaps in my code, but I definitely should look into it, as it feels like it should be solvable, especially with SVGs. I opted for SVGs so I could give my icons the user-selected background color with CSS.
maybe something like: your canvas is set to an initial size and then a smaller SVG is drawn inside it. When that's saved for display the resulting .png isn't the same size as the canvas so the browser moves things around a little?
What would happen if you started your SVG output by drawing a canvas-dimensioned border?