Implemented png saving and improved png loading.