HTML in-line image encoder
This page uses the javascipt FileReader() interface and may only work with a recent version of firefox or google-chrome.
The generated img tag will look like this: <img src="data:image/gif;base64,ImageAsBase64Data">
You can use the following linux shell script for a bit larger images but it is not recommend to include large files
in-line in a web-page.
if [ ! -r "$1" ]; then
echo "Usage: base64-image.sh someImageFile"
mimetype=`file -b --mime-type $1`
echo -n "<img src=\"data:$mimetype;base64,"
base64 -w0 $1
Written by Guido Socher, MIT license
, version: 2018-05-20