-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitializeBaseBracketGraphics.py
More file actions
43 lines (36 loc) · 1 KB
/
initializeBaseBracketGraphics.py
File metadata and controls
43 lines (36 loc) · 1 KB
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
34
35
36
37
38
39
40
41
42
43
## Generate Base Bracket
from PIL import Image
import numpy as np
def initializeBaseBracketGraphics(teams):
numTeams = len(teams)
Round0_vec = np.array(
[[200, 200],
[200, 900],
[200, 1500],
[200, 2200],
[200, 3000],
[200, 3700],
[200, 4300],
[200, 5000],
[5000, 200],
[5000, 900],
[5000, 1500],
[5000, 2200],
[5000, 3000],
[5000, 3700],
[5000, 4300],
[5000, 5000]])
r,c = Round0_vec.shape
# Open all team logos
Logo_vec = []
for i in range(numTeams):
str = "BracketLogos/"+ teams[i].name + "Circle.png"
Logo_vec.append( Image.open(str) )
# Open the greyCircle image
Base = Image.open("BracketResults\GreyBase.png")
# Add all teams to grey circle
for i in range(numTeams):
Base.paste( Logo_vec[i] , tuple(Round0_vec[i]) )
# display(Base)
Base.save("BracketResults\BaseBracket.png")
Base.save("BracketResults\MasterBracket.png")