-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen_test.py
More file actions
33 lines (26 loc) · 945 Bytes
/
Copy pathgen_test.py
File metadata and controls
33 lines (26 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from PIL import Image, ImageDraw
def generate_test_pattern(filename):
width, height = 320, 240
img = Image.new('RGB', (width, height), color='white')
draw = ImageDraw.Draw(img)
# Color Bars
colors = [
(255, 255, 255), # White
(255, 255, 0), # Yellow
(0, 255, 255), # Cyan
(0, 255, 0), # Green
(255, 0, 255), # Magenta
(255, 0, 0), # Red
(0, 0, 255), # Blue
(0, 0, 0) # Black
]
bar_width = width // len(colors)
for i, color in enumerate(colors):
draw.rectangle([i * bar_width, 0, (i + 1) * bar_width, height], fill=color)
# Add some text
draw.text((10, 10), "SSTV TEST", fill=(0, 0, 0))
draw.text((10, 30), "Robot 36", fill=(0, 0, 0))
img.save(filename)
print(f"Generated test image: {filename}")
if __name__ == "__main__":
generate_test_pattern("test_pattern.png")