I agree with @olt. Looks like encoderinfo['transparency'] can be an int representing # of bytes, the output type of ImageFile._safe_read (bytes or string), or an int16, or a 3-tuple of int16.  Line 557 should be a * instead of +.

If we're round tripping the transparency with no change, then it looks like line 554 should be:
```python
   chunk(fp, b"tRNS", im.encoderinfo["transparency"])
```
Since we get a bytes/string when we don't find a \0 in the tRNS chunk.

(note that I have not checked the spec to see how well this is reflected in the proper format of a png image)