Last active
June 25, 2018 21:53
-
-
Save glegoux/57af279ff22629594830418fc5bbdb53 to your computer and use it in GitHub Desktop.
[Bash] Convert image PNG to base 64 and copy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd $(dirname "$0") | |
img_file="$1" | |
# data:image/png;base64,<content base 64> | |
# data:image/svg+xml;base64,<content base 64> | |
base64 -w 0 "${img_file}" | xclip -selection c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment