def export_image(
    client,
    file_type,
    file_=None,
    filename=None,
    height=None,
    width=None,
    dpi=None,
    depth=None,
):
    """Export a model to an image file.

    Args:
        client (obj):
            creopyson Client.
        file_type (str):
            Image Type. Valid values: BMP, EPS, JPEG, TIFF.
        `file_` (str, optional):
            Model name. Defaults is current active model.
        filename (str, optional):
            Destination file name. May also contain a path to the file.
            Defaults is the model name with the appropriate file extension,
            in Creo's working directory.
        height (float, optional):
            Image height. Defaults is `7.5`.
        width (float, optional):
            Image width. Defaults is `10.0`.
        dpi (int, optional):
            Image DPI. Defaults is `100`.
            Valid values: 100, 200, 300, 400.
        depth (int, optional):
            Image depth. Defaults is `24`.
            Valid values: 8, 24.

    Returns:
        dict:
            dirname (str): Directory of the output file
            filename (str): Name of the output file

    """
    data = {"type": file_type}
    if file_ is not None:
        data["file"] = file_
    else:
        active_file = client.file_get_active()
        if active_file:
            data["file"] = active_file["file"]
    if filename is not None:
        data["filename"] = filename
    # if dirname:
    #     data["dirname"] = dirname
    if height is not None:
        data["height"] = height
    if width is not None:
        data["width"] = width
    if dpi is not None:
        data["dpi"] = dpi
    if depth is not None:
        data["depth"] = depth
    return client._creoson_post("interface", "export_image", data)