top of page
Search

PYTHON CODING

  • Writer: waclaw_koscielniak
    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)



Try your own version.
Try your own version.


























 
 
 

Comments

Couldn’t Load Comments
It looks like there was a technical problem. Try reconnecting or refreshing the page.
bottom of page