Encode a file to base64
$ base64 filename > outputfile
Decode a base64 file:
$ base64 --decode filename > outputfile
Embed a base64 image
in HTML
<img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />
in CSS
div.image { width:100px; height:100px; background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...); }