code: def write_array(self, outfile, pixels):
          
  
          if self.interlace:
              if type(pixels) != array:
                  # Coerce to array type
                  fmt = 'BH'[self.bitdepth > 8]
                  pixels = array(fmt, pixels)
              self.write_passes(outfile, self.array_scanlines_interlace(pixels))
          else:
              self.write_passes(outfile, self.array_scanlines(pixels))
docs: Write an array that holds all the image values
          as a PNG file on the output file.
          See also :meth:`write` method.