import base64


def decode_image(file):
    """
    read image file by binary and decode to base64
    
    Parameters
    ----------
    file : string
        input file path with directory path
    
    Returns
    -------
    string
        utf-8 string decoding binary.
    """
    with open(file, "rb") as img:
        data = base64.b64encode(img.read())
    return data.decode('utf-8')