PYTHON CODING
- waclaw_koscielniak
- Sep 25
- 1 min read
from PIL import Image, ImageDraw
import random
w,h,l = 1000,1000,333
img = Image.new("RGB", (w,h), "black")
draw = ImageDraw.Draw(img)
for i in range(500):
x1, y1 = random.randint(0,w), random.randint(0,h)
x2, y2 = x1 + random.randint(-l,l), y1 + random.randint(-l,l)
x3, y3 = x1 + random.randint(-l,l), y1 + random.randint(-l,l)
color = (random.randint(0,255), random.randint(0,255), random.randint(0,255))
draw.polygon([(x1,y1),(x2,y2),(x3,y3)], fill=color)
img.show()

Comments