Read a PNG file and decode it into a single array of values. Returns (*width*, *height*, *values*, *info*). May use excessive memory. `values` is a single array. The :meth:`read` method is more stream-friendly than this, because it returns a sequen
(self)
| 1852 | return self.width, self.height, rows, info |
| 1853 | |
| 1854 | def read_flat(self): |
| 1855 | """ |
| 1856 | Read a PNG file and decode it into a single array of values. |
| 1857 | Returns (*width*, *height*, *values*, *info*). |
| 1858 | |
| 1859 | May use excessive memory. |
| 1860 | |
| 1861 | `values` is a single array. |
| 1862 | |
| 1863 | The :meth:`read` method is more stream-friendly than this, |
| 1864 | because it returns a sequence of rows. |
| 1865 | """ |
| 1866 | |
| 1867 | x, y, pixel, info = self.read() |
| 1868 | arraycode = "BH"[info["bitdepth"] > 8] |
| 1869 | pixel = array(arraycode, itertools.chain(*pixel)) |
| 1870 | return x, y, pixel, info |
| 1871 | |
| 1872 | def palette(self, alpha="natural"): |
| 1873 | """ |