I have no idea how you are going from Photoshop to PNG to this array data, but that is not the form used by PNG. In particular, PNG-8 does not contain a 2D array of RGB or RGBA values, one per pixel; that would be impossible, since you have only 8 bits per pixel. Rather it stores a 2D array of indexes. Each index looks up an RGB value (not RGBA). A PNG-8 file may additionally include a tRNS chunk, which gives transparency values for specific index values.