mac : png to base64

$ openssl
OpenSSL> base64 -in "test.png" -out "test.txt"

 

openssl base64 -in test.png -out test.txt

 

echo -n "data:image/png;base64,$(cat test.png | base64 | tr -d '\r\n')" > test.txt

 

sips -s format jpeg test.png --out test.jpg

sips -s format bmp test.jpg --out test.bmp