from pathlib import Path from PIL import Image # Each character is exactly one pixel; dots are transparent. PIXELS = [ '................', '........##......', '.......#SS#.....', '......#SHHS#....', '.....#SHHSS###..', '....#SHHSS#WW#..', '....#SSSS#WL#...', '.....###WWL#....', '.......#WL#.....', '......#WL#......', '.....#WL#.......', '....#WL#........', '...#WL#.........', '..#WD#..........', '..###...........', '................', ] PALETTE = { '.': (0, 0, 0, 0), '#': (32, 39, 48, 255), 'S': (132, 155, 170, 255), 'H': (222, 239, 242, 255), 'W': (155, 91, 46, 255), 'L': (219, 161, 84, 255), 'D': (103, 61, 38, 255), } assert len(PIXELS) == 16 and all(len(row) == 16 for row in PIXELS) image = Image.new('RGBA', (16, 16)) image.putdata([PALETTE[pixel] for row in PIXELS for pixel in row]) folder = Path(__file__).resolve().parent image.save(folder / 'diagonal_axe.png') image.resize((512, 512), Image.Resampling.NEAREST).save(folder / 'diagonal_axe_preview.png') print('Exported 16×16 RGBA PNG and 512×512 nearest-neighbor preview.')