locs = numpy.indices(rows.shape[0:2])
rows[(locs[0] - 80) ** 2 + (locs[1] - 80) ** 2 <= 20 ** 2] = [255, 255, 0, 255]
png_writer = png.Writer(width=256, height=256, alpha='RGBA')
png_writer.write(open('colors_panel.png', 'wb'), rows.reshape(rows.shape[0],
    rows.shape[1] * rows.shape[2]))
PyPNG to draw a simple filled box