SymptoScanMD / image_utils.py
dkg-2's picture
Upload 6 files
3ccb758 verified
raw
history blame contribute delete
221 Bytes
import base64
def encode_image(image_path):
"""
Encodes an image file to a base64 string.
"""
with open(image_path, "rb") as image_file:
return base64.b64encode(image_file.read()).decode('utf-8')