Created
March 24, 2016 11:41
-
-
Save tmthydvnprt/884c07cdca6a4624969f to your computer and use it in GitHub Desktop.
create base64 image
This file contains hidden or 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
| import base64 | |
| with open("/path/to/your/image.png", "rb") as image_file: | |
| encoded_string = base64.b64encode(image_file.read()) | |
| print 'data:image/png;base64,'+encoded_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment