import base64


def image_to_base_64_bytes(path):
    """
    This takes a path and returns a byte array from the image. This byte array
    is base 64

    Exceptions:
      IOError if the path does not exist.

    """
    with open(path, "rb") as image:
        data = base64.standard_b64encode(image.read())
    return data