(array, width, counter=[1])
| 17 | break |
| 18 | |
| 19 | def create_image(array, width, counter=[1]): |
| 20 | image = BitMap(width, len(array) // width) |
| 21 | for index, pixel in enumerate(array): |
| 22 | image.setPenColor(PALETTE[pixel]) |
| 23 | image.plotPoint(*reversed(divmod(index, width))) |
| 24 | image.saveFile(str(counter[0]) + '.bmp') |
| 25 | counter[0] += 1 |
| 26 | |
| 27 | ################################################################################ |
| 28 |