Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Convert An Image To base64 On The Command Line

Use the [TODO: Code shorthand span ] command with the [TODO: Code shorthand span ] operator to convert an image to base64 and save the string in a file :

bash
base64 IMAGE_FILE.jpg > OUTPUT.txt

You can also export it into an environmental variable for use in other scripts

bash
export IMAGE_STRING=$(base64 IMAGE_FILE.jpg)
echo $IMAGE_STRING