Convert an image to a Base64 data URL.
The full data URL includes a prefix like data:image/png;base64, which browsers and CSS can use directly (e.g. background-image: url(...)). The raw Base64 is just the encoded bytes, useful when you need to build the data URL yourself or pass it to an API that expects bare Base64.
It avoids an extra network request for small icons or images, which can help in emails, single-file HTML documents, or inlining a small logo in CSS.
The encoded text is about 33% larger than the original binary file, and it can't be cached separately by the browser the way a linked image file can — best for small images only.