I recently came across Data URI scheme and was reading about it on Wikipedia.
Example code looks something like this:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
My question is this: How do you generate the code (IE: iVBORw0KGgoAAAA...
) for using on a website?
Note: I am specifically looking for how this is done with no server side scripts. But you can still post server side script ways for others who may come across this question. Also I have seen websites that will do this for you, how can I do it myself?
data:image/png;base64,
) that you need to use some MIME detection function to get the MIME type.