Created
September 1, 2022 22:44
-
-
Save luisgdev/c27e9808cf20aef718bc24fbbb46791b to your computer and use it in GitHub Desktop.
Convert image to base64
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 | |
| image_path = 'IMG_01.jpg' | |
| with open(image_path, 'rb') as image: | |
| result = base64.b64encode(image.read()).decode('utf-8') | |
| print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment