This seems fairly simple:
import png
rdr = png.Reader(filename='help.png')
width, height, pixels, metadata = rdr.read()
with open('help-new.png', 'w') as outfile:
png.Writer(**metadata).write(outfile, pixels)
However, I can't open my new image because the file "appears to be damaged, corrupted, or too large". If I try to load the result back into PyPNG, I get this:
FormatError: FormatError: PNG file has invalid signature.
Additional info: The metadata looks like this:
'bitdepth': 8, 'interlace': 0, 'planes': 1,
'greyscale': False, 'alpha': False, 'size': (18, 18)
The first palette entry is (0, 0, 0, 0), while the others are all of the form (255, 255, 255, A) where A is between 0 and 255. The source file is 718 bytes, result file is 748 bytes.