import base64


def encode_image_string(filename):
    """
    Returns the base64 encoded string for an image file.

    :param filename: image file to base64 encode
    :return: base64 string for image
    """
    with open(filename, "rb") as image_file:
        image_string = base64.b64encode(image_file.read())
        return image_string