SVG can contain images, including data URL ones, what's missing?
Is there no gradient style that could be used to encode pixels, directly using the schema?
A PNG would have been better, but a PNG is not programmable, so I lamented the SVG spec not having a programmable bitmap, since lots of people use it for plotting data.
There are also specialist tools for dealing with web raster layers, like in GIS: https://openlayers.org/en/latest/examples/raster.html
This just shouldn't be a job for SVG, IMO.