import base64


def to_base64(img_filepath: str) -> str:
    """Returns base64 representation of an image."""
    with open(img_filepath, "rb") as img:
        img_data = img.read()

    b64_bytes = base64.b64encode(img_data)
    b64_string = b64_bytes.decode()

    return b64_string