saveFrameToPng results in dark images if project color is set to >8 bit depth.
E.g. if you use extend script (e.g. comp.saveFrameToPng) to export a frame and your Project settings > Color uses 32 bit depth, the PNG will be dark. Changing the project's color depth to 8 bit before export results in images as expected.