import base64


def base64_from_image(image_path):
    """
    Encodes an image in base64 (> str)
    """
    image = open(image_path, 'rb')
    image_content = image.read()
    image.close()
    return(base64.b64encode(image_content).decode('ascii'))