simulation

This commit is contained in:
2023-02-12 22:39:13 +01:00
parent c1957722c2
commit 307b0e307b
11 changed files with 165 additions and 0 deletions

20
simulation/t.py Normal file
View File

@ -0,0 +1,20 @@
import png
width = 2400
height = 1000
img = []
for y in range(height):
row = ()
for x in range(int(width/3)):
row = row + (255, 0, 0)
for x in range(int(width/3)):
row = row + (0, 255, 0)
for x in range(int(width/3)):
row = row + (0, 0, 255)
img.append(row)
with open('gradient.png', 'wb') as f:
w = png.Writer(width, height, greyscale=False)
w.write(f, img)