How to Make a Target with Python: Any Tips or Step-by-Step Guides?

16 Replies, 1939 Views

Hey! I’d suggest using PIL (Pillow) if you’re looking for something lightweight and image-based. You can create a blank image and draw circles on it. Here’s a quick example:

```python
from PIL import Image, ImageDraw

img = Image.new('RGB', (400, 400), 'white')
draw = ImageDraw.Draw(img)
colors = ['red', 'white']

for i in range(5):
draw.ellipse((50 + i*40, 50 + i*40, 350 - i*40, 350 - i*40), fill=colors[i % 2])

img.show()
```

This creates a target image you can save or display. Super simple and effective!

Messages In This Thread



Users browsing this thread: 1 Guest(s)