I have implemented embedding bitmap images into the svg for Graphite, a work in progress vector editor written in the Rust programming language with Web Assembly. The system allows you to drag and drop a PNG or JPEG file from your file manager and then load it into the editor for use as a reference. View the code on GitHub.
Challenges with this MR included handling the file dropping, as well as making the svg performant when a large (several megabytes) image is being transformed around. This was achieved through blob urls so the image data is not stored in the svg node but seperatly in the browser, greatly increasing performance. However this meant I had to load all the blob urls for the images when loading a graphite document.
I am doing lots of projects every projects all the time and I can't put them all on the website so I've made a blog.