added png+bmp support, modified graph.cpp