Skip to content

Instantly share code, notes, and snippets.

@davidicus
Created April 2, 2019 13:58
Show Gist options
  • Save davidicus/24d2eec06692f6081825ed9265bbf7f9 to your computer and use it in GitHub Desktop.
Save davidicus/24d2eec06692f6081825ed9265bbf7f9 to your computer and use it in GitHub Desktop.
Create Data URI from image
# https://superuser.com/questions/120796/how-to-encode-base64-via-command-line#comment280484_120815
# create and copy URI to clipboard
openssl base64 < path/to/file.png | tr -d '\n' | pbcopy
# or
cat path/to/file.png | openssl base64 | tr -d '\n' | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment