mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
745 B
745 B
| 1 | # PNG to CSV Conversion |
|---|---|
| 2 | # Original PNG: standalone_cubes_frame.png |
| 3 | # Dimensions: 1024x768 |
| 4 | # Color Type: RGBA |
| 5 | # Bit Depth: 8 |
| 6 | # Total Pixels: 786432 |
| 7 | # File Size: 3150399 bytes |
| 8 | # |
| 9 | # To generate full pixel data, run: |
| 10 | # python3 << 'PYTHON_EOF' |
| 11 | # from PIL import Image |
| 12 | # import csv |
| 13 | # img = Image.open('test_outputs/standalone_cubes_frame.png') |
| 14 | # if img.mode != 'RGB': img = img.convert('RGB') |
| 15 | # with open('test_outputs/standalone_cubes_frame.csv', 'w') as f: |
| 16 | # w = csv.writer(f) |
| 17 | # w.writerow(['x', 'y', 'r', 'g', 'b', 'hex']) |
| 18 | # for y in range(img.height): |
| 19 | # for x in range(img.width): |
| 20 | # r, g, b = img.getpixel((x, y))[:3] |
| 21 | # w.writerow([x, y, r, g, b, f'#{r:02x}{g:02x}{b:02x}']) |
| 22 | # PYTHON_EOF |
| 23 | # |
| 24 | x,y,r,g,b,hex |