Using binary image data to display an image in HTML

July 25, 2012

I learned a new trick with the HTML image tag <img> today. It blew my feeble little mind and I have to share it with you. You can use binary data in an <img> tag to display an image without needing a file sitting on the drive somewhere! Too Cool! I found this by accident when I drug an image file into the WordPress post editor and it worked. The following is an example of what it looks like and displays an image of a boat similar to my own

The code to do this looks like:

Using binary image data to display an image in HTML

Check the source code of this page if you do not believe me ;).

If you are doing this in WordPress you even still retain the ability to edit the image with the built in media editor.