Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image, ImageDraw
- from random import randint, choice
- WIDTH = randint(500, 1500)
- HEIGHT = randint(300, 1300)
- WHITE = (255, 255, 255)
- COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (0, 255, 255)]
- CIRCLES = randint(1, 20)
- image = Image.new("RGB", (WIDTH, HEIGHT), WHITE)
- draw = ImageDraw.Draw(image)
- for i in range(CIRCLES):
- radius = randint(20, 100)
- x = randint(radius, WIDTH - radius)
- y = randint(radius, HEIGHT - radius)
- draw.ellipse([(x - radius, y - radius), (x + radius, y + radius)], fill=choice(COLORS))
- image.save("1.png")
- image.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement