- added docs to encodeToPNG