import json


def server_gui(Images, Timestamps, og_height, og_width,
               Pro_images, Pro_times, pro_height, pro_width,
               og_histo, pro_histo):
    """
        Packs the data for the processed image into a dict
        to be sent back to the gui

    :param Images: list of encoded og images
    :param Timestamps: list of datatime objects, when images
    were uploaded
    :param og_height: list that contains the orginal images
    heights
    :param og_width: list that contains the original image
    widths
    :param Pro_images: list of encoded processed images
    :param Pro_times: list of times that it took to process
    the image
    :param pro_height: list that contains the processed
    image's heights
    :param pro_width: list that contains the processed
    image's widths
    :param og_histo: list that contains the histograms
    for the original image channels
    :param pro_histo: list that contains the histograms
    for the processed image channels
    :return: dict that contains the all the information
    described above
    """
    return_data = {
        "OG Images": str(Images),
        "Timestamps": str(Timestamps),
        "OG Height": str(og_height),
        "OG Width": str(og_width),
        "Processed Images": str(Pro_images),
        "Time Spent": str(Pro_times),
        "Processed Height": str(pro_height),
        "Processed Width": str(pro_width),
        "OG Histograms": json.dumps(og_histo),
        "Processed Histograms": json.dumps(pro_histo)
    }
    r = json.dumps(return_data)

    return r