Split write_passes into IDAT generator and writer
Specify the values in our arrays are contiguous in memory.

from
https://github.com/e98cuenc/pypng/commit/0674018b29b01b33e9091a761106dfdc3df2076d
Add code for applying alpha channel

This can be useful for picture viewer or something like this.