Convert Texture to data URI

Is it possible to get the image data from a Texture object and massage that into being a data URI?

The specific example is I have a plugin that grabs a player’s Steam avatar as a Texture, and I’d like to send that to a web page – I’m using a plugin that allows me to render HTML web pages in-game (which I want to use for the HUD).

I’m thinking it’s possible to extract the data via the various Mips functions/properties but unsure how.