-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_logo.py
More file actions
81 lines (69 loc) · 3.01 KB
/
Copy pathmake_logo.py
File metadata and controls
81 lines (69 loc) · 3.01 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""QuestLoot logo: treasure chest + gold quest exclamation mark.
Renders at 1024 (supersampled) and downsamples to 512 for crisp edges.
"""
from PIL import Image, ImageDraw, ImageFilter
S = 1024
OUT = 512
# palette
BG = (35, 42, 54, 255) # deep slate
BG_RING = (47, 56, 71, 255)
GOLD = (245, 197, 66, 255) # bright gold
GOLD_D = (181, 134, 24, 255) # gold shadow
WOOD = (122, 74, 38, 255) # chest body
WOOD_D = (84, 49, 22, 255) # chest shadow / lid
WOOD_L = (150, 96, 52, 255) # chest highlight
DARK = (40, 24, 12, 255) # keyhole / deep lines
img = Image.new("RGBA", (S, S), (0, 0, 0, 0))
d = ImageDraw.Draw(img)
# ---- background rounded square ----
d.rounded_rectangle([8, 8, S - 8, S - 8], radius=180, fill=BG)
# subtle inner ring
d.rounded_rectangle([40, 40, S - 40, S - 40], radius=150, outline=BG_RING, width=10)
# ---- glow behind the exclamation ----
glow = Image.new("RGBA", (S, S), (0, 0, 0, 0))
gd = ImageDraw.Draw(glow)
gd.ellipse([512 - 190, 120, 512 + 190, 500], fill=(245, 197, 66, 130))
glow = glow.filter(ImageFilter.GaussianBlur(70))
img = Image.alpha_composite(img, glow)
d = ImageDraw.Draw(img)
# ---- quest exclamation mark (gold, tapered) ----
cx = 512
# stem as polygon, wide at top, narrow at bottom
stem = [(cx - 40, 150), (cx + 40, 150), (cx + 26, 360), (cx - 26, 360)]
d.polygon(stem, fill=GOLD, outline=GOLD_D)
# top rounded cap
d.ellipse([cx - 40, 122, cx + 40, 190], fill=GOLD, outline=GOLD_D, width=3)
# dot
d.ellipse([cx - 40, 410, cx + 40, 490], fill=GOLD, outline=GOLD_D, width=4)
# inner highlight on stem
d.polygon([(cx - 22, 165), (cx - 4, 165), (cx - 10, 345), (cx - 18, 345)], fill=(255, 224, 130, 200))
# ---- treasure chest ----
L, R = 252, 772 # chest left/right
# body
d.rounded_rectangle([L, 600, R, 830], radius=26, fill=WOOD, outline=WOOD_D, width=10)
# lid (rounded top)
d.rounded_rectangle([L, 500, R, 660], radius=70, fill=WOOD_D, outline=DARK, width=8)
# flatten lid bottom so it merges with body
d.rectangle([L, 620, R, 660], fill=WOOD_D)
# lid highlight
d.arc([L + 14, 506, R - 14, 700], start=180, end=360, fill=WOOD_L, width=10)
# horizontal gold band (lid / body seam)
d.rectangle([L - 4, 612, R + 4, 660], fill=GOLD)
d.rectangle([L - 4, 612, R + 4, 620], fill=GOLD_D)
# vertical gold band + lock plate (center)
d.rectangle([cx - 34, 500, cx + 34, 830], fill=GOLD)
d.rectangle([cx - 34, 500, cx - 26, 830], fill=GOLD_D)
# lock
d.rounded_rectangle([cx - 52, 648, cx + 52, 752], radius=16, fill=GOLD, outline=GOLD_D, width=6)
# keyhole
d.ellipse([cx - 16, 678, cx + 16, 710], fill=DARK)
d.polygon([(cx - 10, 700), (cx + 10, 700), (cx + 16, 736), (cx - 16, 736)], fill=DARK)
# metal corner fittings
for fx in (L, R - 44):
d.rounded_rectangle([fx, 786, fx + 44, 824], radius=8, fill=GOLD, outline=GOLD_D, width=4)
# ---- downsample ----
img = img.resize((OUT, OUT), Image.LANCZOS)
img.save(r"C:\Users\Yannic\Desktop\WOW\questloot-logo.png")
# also a 1024 version for high-res use
img2 = Image.new("RGBA", (S, S), (0, 0, 0, 0))
print("saved 512 logo")