About image to base64
Base64 turns the bytes of an image into plain text. That text can be placed in HTML, CSS or JSON as a data URL, so the picture travels inside the file instead of being a separate download.
When this is useful
Small icons in CSS, images in single-file HTML emails and test data for an API are common uses. It saves a network request for a tiny file.
When to avoid it
Base64 makes data about one third larger, and the browser cannot cache an embedded image separately. For anything bigger than a few kilobytes, a normal image file is faster.
Using the result
A data URL looks like data:image/png;base64,iVBOR... and can be used directly as an image source or in a CSS url(). Keep the part before the comma, because it tells the browser the file type.
