def bpmn_diagram_to_png(bpmn_diagram, file_name):
g = bpmn_diagram.diagram_graph<EOL>graph = pydotplus.Dot()<EOL>for node in g.nodes(data=True):<EOL><INDENT>if node[<NUM_LIT:1>].get(consts.Consts.type) == consts.Consts.task:<EOL><INDENT>n = pydotplus.Node(name=node[<NUM_LIT:0>], shape="<STR_LIT>", style="<STR_LIT>", label=node[<NUM_LIT:1>].get(consts.Consts.node_name))<EOL><DEDENT>elif node[<NUM_LIT:1>].get(consts.Consts.type) == consts.Consts.exclusive_gateway:<EOL><INDENT>n = pydotplus.Node(name=node[<NUM_LIT:0>], shape="<STR_LIT>", label=node[<NUM_LIT:1>].get(consts.Consts.node_name))<EOL><DEDENT>else:<EOL><INDENT>n = pydotplus.Node(name=node[<NUM_LIT:0>], label=node[<NUM_LIT:1>].get(consts.Consts.node_name))<EOL><DEDENT>graph.add_node(n)<EOL><DEDENT>for edge in g.edges(data=True):<EOL><INDENT>e = pydotplus.Edge(src=edge[<NUM_LIT:0>], dst=edge[<NUM_LIT:1>], label=edge[<NUM_LIT:2>].get(consts.Consts.name))<EOL>graph.add_edge(e)<EOL><DEDENT>graph.write(file_name + "<STR_LIT>", format='<STR_LIT>')<EOL>
Create a png picture for given diagram

:param bpmn_diagram: an instance of BPMNDiagramGraph class,
:param file_name: name of generated file.