import base64


def img_to_base64(img_path):
    """ Returns base64 string in payload format for a given image path """
    with open(img_path, "rb") as img_file:
        imgb64_string = base64.b64encode(img_file.read()).decode("utf-8")
        payload_data = f'{{"image": "{imgb64_string}"}}'
    return payload_data