- The code currently makes an assumption that the first color in the palette is transparent and the remainder are opaque. - That isn't necessarily the case, as documented [here](https://www.w3.org/TR/2003/REC-PNG-20031110/#11tRNS). - The code should instead read the `tRNS` chunk to assign transparency to each palette entry.