added setPNG and setJSON methods