def convert_ppm(self, ppmfile, outfile):
        if self.interlaced:
            pixels = array('B')
            pixels.fromfile(ppmfile,
                            self.bytes_per_sample * self.color_depth *
                            self.width * self.height)
            self.write(outfile, self.array_scanlines_interlace(pixels))
        else:
            self.write(outfile, self.file_scanlines(ppmfile))
Convert a PPM file containing raw pixel data into a PNG file
dataset/ETHPy150Open ardekantur/pyglet/pyglet/image/codecs/pypng.py/Writer.convert_ppm