← back to Beverlyhillsvideos
filmgen/logo_variants.py
96 lines
#!/usr/bin/env python3
"""Generate BHV logo/avatar options (1080x1080) — $0, local. Writes filmgen/work/logo-*.png."""
import os, math
from PIL import Image, ImageDraw, ImageFont, ImageFilter
S = 1080
GREEN, GREEN2 = (18, 40, 31), (9, 22, 17)
CREAM, GOLD, MUTED = (246, 243, 236), (184, 147, 90), (176, 170, 158)
SERIF = "/System/Library/Fonts/Supplemental/Didot.ttc"
SANS = "filmgen/fonts/Jost.ttf"
sf = lambda s: ImageFont.truetype(SERIF, s)
jf = lambda s: ImageFont.truetype(SANS, s)
OUT = "filmgen/work"; os.makedirs(OUT, exist_ok=True)
def ctr(d, cy, y, txt, fnt, fill):
w = d.textlength(txt, font=fnt); d.text((cy - w/2, y), txt, font=fnt, fill=fill)
def trk(d, cy, y, txt, fnt, fill, tr):
ws = [d.textlength(c, font=fnt) for c in txt]; tot = sum(ws)+tr*(len(txt)-1); x = cy-tot/2
for c, w in zip(txt, ws): d.text((x, y), c, font=fnt, fill=fill); x += w+tr
def ground(green=True):
if green:
img = Image.new("RGB", (S, S), GREEN)
vig = Image.new("L", (S, S), 0)
ImageDraw.Draw(vig).ellipse([-S*0.2,-S*0.2,S*1.2,S*1.2], fill=110)
vig = vig.filter(ImageFilter.GaussianBlur(200))
img = Image.composite(img, Image.new("RGB",(S,S),GREEN2), vig)
else:
img = Image.new("RGB", (S, S), CREAM)
return img
def ring(d, inset, color=GOLD, w=3):
d.ellipse([inset, inset, S-inset, S-inset], outline=color, width=w)
# V1 — refined BHV monogram, breathing room, double hairline ring
def v1():
img = ground(); d = ImageDraw.Draw(img)
ring(d, 70, GOLD, 3); ring(d, 84, GOLD, 1)
ctr(d, S/2, S*0.30, "BHV", sf(300), GOLD)
d.line([(S/2-70, S*0.585), (S/2+70, S*0.585)], fill=GOLD, width=2)
trk(d, S/2, S*0.66, "BEVERLY HILLS VIDEOS", jf(34), CREAM, 12)
img.save(f"{OUT}/logo-v1.png")
# V2 — wordmark stack, no ring
def v2():
img = ground(); d = ImageDraw.Draw(img)
trk(d, S/2, S*0.24, "THE INSIDER FILM GUIDE", jf(26), GOLD, 10)
ctr(d, S/2, S*0.33, "Beverly", sf(150), CREAM)
ctr(d, S/2, S*0.48, "Hills", sf(150), CREAM)
ctr(d, S/2, S*0.63, "Videos", sf(150), CREAM)
d.line([(S*0.30, S*0.82), (S*0.70, S*0.82)], fill=GOLD, width=2)
img.save(f"{OUT}/logo-v2.png")
# V3 — big BH monogram, ring, wordmark
def v3():
img = ground(); d = ImageDraw.Draw(img)
ring(d, 74, GOLD, 2)
ctr(d, S/2, S*0.26, "BH", sf(420), CREAM)
trk(d, S/2, S*0.70, "BEVERLY HILLS VIDEOS", jf(32), GOLD, 12)
img.save(f"{OUT}/logo-v3.png")
# V4 — cream inverse, green BHV
def v4():
img = ground(green=False); d = ImageDraw.Draw(img)
ring(d, 74, GREEN, 3)
ctr(d, S/2, S*0.30, "BHV", sf(300), GREEN)
d.line([(S/2-70, S*0.585), (S/2+70, S*0.585)], fill=GOLD, width=3)
trk(d, S/2, S*0.66, "BEVERLY HILLS VIDEOS", jf(34), (120,110,95), 12)
img.save(f"{OUT}/logo-v4.png")
# V5 — badge: BEVERLY HILLS top, BHV center, VIDEOS · CALIFORNIA bottom
def v5():
img = ground(); d = ImageDraw.Draw(img)
ring(d, 66, GOLD, 3)
trk(d, S/2, S*0.20, "BEVERLY HILLS", jf(40), GOLD, 10)
ctr(d, S/2, S*0.34, "BHV", sf(280), CREAM)
d.line([(S/2-90, S*0.66), (S/2+90, S*0.66)], fill=GOLD, width=2)
trk(d, S/2, S*0.72, "VIDEOS · CALIFORNIA", jf(32), MUTED, 10)
img.save(f"{OUT}/logo-v5.png")
# V6 — film motif: small play triangle over BHV
def v6():
img = ground(); d = ImageDraw.Draw(img)
ring(d, 74, GOLD, 2)
cx, ty = S/2, S*0.235
r = 26
d.polygon([(cx-r*0.7, ty-r), (cx-r*0.7, ty+r), (cx+r, ty)], fill=GOLD)
ctr(d, S/2, S*0.34, "BHV", sf(290), CREAM)
d.line([(S/2-70, S*0.63), (S/2+70, S*0.63)], fill=GOLD, width=2)
trk(d, S/2, S*0.70, "BEVERLY HILLS VIDEOS", jf(32), GOLD, 12)
img.save(f"{OUT}/logo-v6.png")
for f in (v1, v2, v3, v4, v5, v6): f()
print("wrote logo-v1..v6")