Embedding images into html

A few days ago I met a small html snippet with an image embedded in it. As it turns out, any data can be embedded this way:

<img src="data:image/gif;base64,
R0lGODlhEAAQAPZMAGdnZ3x8fP9yFf9/K/+DMf+EM/+FNf+IOv+KPP+NQv+OQ/+PRf+RSP+TTP+W
UP+XUv+ZVf+aV/+cW/+dXf+fX/+fYP+gYf+gYv+iZf+jZv+kaP+lav+obv+ob/+pcf+qcv+rdP+u
ef+vev+xfYiIiJSUlJmZmaKioqWlpaenp6mpqaysrLGxsbW1tba2tre3t7i4uLq6uv+1hP+9kf++
k8HBwcfHx8vLy8/Pz9bW1t7e3v/o2ebm5ufn5+7u7v/s4P/y6v/z7PHx8fX19fb29vf39//28f/4
9Pj4+Pn5+fv7+/z8/P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5
BAAAAAAALAAAAAAQABAAAAeGgBU0MoQcFSAghIQgEiMXQUCRP0dMlZaVjZeamhEam59MEx+gmw4j
lSsupEcYp0wwoERMRgSnOAFCNko5JSclRCYuOw00lbA8AEQqSiguRKofIcZMOiw1NSQ3KiiyGDKf
PKqXHJ6fPpoX0qSX6euXCKPulRMVCwoGAwwRChcGDgUCHGhAEAgAOw==" />

And here's how it looks in html: Embedded Image

Besides images, any other data can be embedded this way. The general schema is:


data:[<mediatype>][;base64],<data>

If ;base64 is omited, data octets should be represented using ascii encoding or using %xx hex notation. Details can be found in rfc2397