Build Drive-In theatre and drive-in scenes from Paul's pictures, renamed
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m48s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m31s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-02 11:53:07 +00:00
co-authored by Claude Opus 5.5
parent 12d651af9e
commit 6003d72b27
12 changed files with 125 additions and 29 deletions
+2 -26
View File
@@ -56,7 +56,7 @@ write('drive_in_ticket', 1024, 332,
orbit(322, 102, 30, 12) + word(318, 222, 106) + text(322, 262, 'Your own big night in', 25, '#F5F1E0', 'Barlow', 'letter-spacing="2"') +
text(884, 126, 'ADMIT', 28, '#F2C14E', 'Barlow Condensed') + text(892, 182, '01', 54, '#F5F1E0', 'Barlow Condensed') + text(876, 228, 'FRONT ROW', 15, '#F2C14E', 'Barlow'))
# The screen: tonight's bill under the marquee, beside a feature shown three ways that take turns: an old drive-in screen, a cinema front and a CRT.
# The screen: tonight's bill under the marquee, beside the feature on a CRT. build-scenes.py makes the theatre and drive-in versions.
art = sys.argv[1] if len(sys.argv) > 1 else None
ART = base64.b64encode(open(art, 'rb').read()).decode() if art else None
def picture(x, y, w, h, title=44, clip=''):
@@ -82,29 +82,6 @@ EXTRA = ('<defs><linearGradient id="wood" x1="0" y1="0" x2="1" y2="1"><stop offs
'<radialGradient id="lamp"><stop offset="0" stop-color="#FFB866" stop-opacity=".3"/><stop offset="1" stop-color="#FFB866" stop-opacity="0"/></radialGradient>'
'<radialGradient id="tube" cx=".5" cy=".5" r=".72"><stop offset=".62" stop-color="#000" stop-opacity="0"/><stop offset="1" stop-color="#000" stop-opacity=".62"/></radialGradient>'
'<clipPath id="crt"><path d="M160 152C340 132 680 132 860 152C884 300 884 640 860 788C680 808 340 808 160 788C136 640 136 300 160 152Z"/></clipPath></defs>')
def oldcar(x, y, s):
return f'<path transform="translate({x},{y}) scale({s})" d="M0 66C0 48 10 42 40 40L84 8C92 2 106 0 122 0H196C214 0 226 6 238 18L256 36C300 30 350 18 392 8C386 26 382 40 382 56L380 80H0Z" fill="#030816"/><circle cx="{x + 74 * s}" cy="{y + 82 * s}" r="{18 * s}" fill="#030816"/><circle cx="{x + 300 * s}" cy="{y + 82 * s}" r="{18 * s}" fill="#030816"/>'
def post(x):
return f'<path d="M{x} 960V880" stroke="#030816" stroke-width="7"/><rect x="{x - 15}" y="862" width="30" height="24" rx="4" fill="#030816"/><circle cx="{x}" cy="874" r="5" fill="#F2C14E"/>'
def drivein():
towers = ''
for x in (150, 950):
towers += f'<path d="M{x} 960V740M{x + 100} 960V740M{x} 960L{x + 100} 850L{x} 740M{x + 100} 960L{x} 850L{x + 100} 740" stroke="#1C2B4C" stroke-width="8" fill="none"/>'
seams = ''.join(f'<path d="M{x} 72V752" stroke="#A89F86" stroke-width="2"/>' for x in range(183, 1150, 139))
return ('<rect width="1920" height="1080" fill="url(#night)"/>' + stars + towers + '<rect x="44" y="72" width="1112" height="680" fill="#D9D2BC"/>' + seams +
'<path d="M44 72H1156" stroke="#F2EDDC" stroke-width="5"/><path d="M44 752H1156" stroke="#8F876F" stroke-width="7"/>' + picture(84, 104, 1032, 580) +
'<rect x="340" y="692" width="520" height="52" fill="#D9D2BC"/>' + text(600, 730, 'ORBIT DRIVE-IN THEATRE', 34, '#0B1F47', 'Barlow Condensed', 'text-anchor="middle" letter-spacing="8"') +
'<rect y="960" width="1920" height="120" fill="#030816"/>' + oldcar(40, 860, 1) + post(490) + oldcar(560, 866, .96) + post(990) + SIDE + HINTS)
def cinema():
doors = ''.join(f'<rect x="{x}" y="716" width="150" height="244" fill="url(#foyer)"/><rect x="{x}" y="716" width="150" height="244" fill="none" stroke="#C98A1E" stroke-width="6"/><path d="M{x + 75} 716V960" stroke="#C98A1E" stroke-width="4"/><circle cx="{x + 65}" cy="850" r="5" fill="#7A4C2A"/><circle cx="{x + 85}" cy="850" r="5" fill="#7A4C2A"/>' for x in (110, 280, 770, 940))
canopy = '<path d="M50 520H1150L1178 690H22Z" fill="#0B1F47" stroke="url(#gold)" stroke-width="4"/>'
canopy += ''.join(bulb(70 + i * 1060 / 26, 532, 5) for i in range(27)) + ''.join(bulb(46 + i * 1108 / 28, 674, 5) for i in range(29))
canopy += '<rect x="170" y="552" width="860" height="104" fill="#F5F1E0"/>' + text(600, 586, 'NOW SHOWING', 26, '#7A1E2C', 'Barlow', 'font-weight="600" text-anchor="middle" letter-spacing="8"') + text(600, 644, 'THE FEATURE TITLE', 52, '#0B1626', 'Anton', 'text-anchor="middle" letter-spacing="3"')
booth = '<rect x="470" y="730" width="260" height="230" rx="10" fill="#2A0E16" stroke="url(#gold)" stroke-width="5"/><path d="M500 760H700V850H500Z" fill="url(#foyer)"/><path d="M490 866H710" stroke="#F2C14E" stroke-width="6"/>' + text(600, 916, 'TICKETS', 34, '#F2C14E', 'Barlow Condensed', 'text-anchor="middle" letter-spacing="5"')
pil = ''.join(f'<path d="M{x} 30V520" stroke="#C98A1E" stroke-width="5"/>' for x in (70, 96, 122, 1078, 1104, 1130))
return ('<rect width="1920" height="1080" fill="url(#night)"/>' + stars + '<rect x="24" y="24" width="1152" height="936" fill="url(#deco)"/>' + pil +
'<rect x="196" y="48" width="808" height="456" fill="#0B1F47" stroke="url(#gold)" stroke-width="4"/>' + bulbs(210, 62, 780, 428, 40, 4.5) + picture(240, 92, 720, 368, 26) +
doors + booth + canopy + '<rect y="960" width="1920" height="120" fill="#100509"/><path d="M500 960H700L780 1080H420Z" fill="#7A1E2C"/>' + SIDE + HINTS)
def crt():
grille = ''.join(f'<path d="M944 {y}H1094" stroke="#1A0F08" stroke-width="5"/>' for y in range(520, 770, 18))
lines = ''.join(f'<path d="M136 {y}H884" stroke="#000" stroke-opacity=".16" stroke-width="2"/>' for y in range(136, 806, 6))
@@ -115,5 +92,4 @@ def crt():
picture(136, 136, 748, 668, 42, 'crt') + f'<g clip-path="url(#crt)">{lines}<rect x="136" y="136" width="748" height="668" fill="url(#tube)"/><path d="M190 180C330 164 480 164 610 176C470 200 310 240 190 300Z" fill="#FFFFFF" fill-opacity=".07"/></g>' +
'<rect x="928" y="124" width="182" height="692" rx="10" fill="#3A2010"/>' + dial(218) + dial(366) + grille + text(1019, 796, 'ORBIT', 26, '#F5F1E0', 'Barlow', 'font-weight="600" text-anchor="middle" letter-spacing="5"') +
'<path d="M160 870V920M1040 870V920" stroke="#1A0F08" stroke-width="22"/><rect y="920" width="1920" height="160" fill="#1A0F08"/><path d="M0 920H1920" stroke="#3A2010" stroke-width="5"/>' + SIDE + HINTS)
for name, draw in (('drive_in_screen_lot', drivein), ('drive_in_screen_cinema', cinema), ('drive_in_screen_crt', crt)):
write(name, 1920, 1080, EXTRA + draw())
write('drive_in_screen_crt', 1920, 1080, EXTRA + crt())
+122
View File
@@ -0,0 +1,122 @@
#!/usr/bin/env python3
"""The theatre and drive-in screens, from Paul's two concept pictures in references/. The old name comes off the sign, the marquee board
and the big screen, leaving blank scenes the app can write on. With an output folder and a picture it also makes mock-ups with sample text."""
import subprocess, sys
from pathlib import Path
from PIL import Image, ImageChops, ImageDraw, ImageFilter
HERE = Path(__file__).parent
W, H = 1920, 1080
CRESCENT = 'M335 132C141 114 66 384 257 475C143 363 185 207 335 132Z'
RING = 'M129 369C102 399 111 425 161 428C267 432 431 340 445 289C455 250 405 250 369 261'
DEFS = ('<defs><linearGradient id="gold" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFF0B8"/><stop offset=".45" stop-color="#F2C14E"/><stop offset=".55" stop-color="#D9982A"/><stop offset="1" stop-color="#F7D678"/></linearGradient>'
'<linearGradient id="silver" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFFFFF"/><stop offset=".44" stop-color="#E8EDF5"/><stop offset=".5" stop-color="#B7CBE8"/><stop offset="1" stop-color="#F5F7FF"/></linearGradient>'
'<linearGradient id="scrim" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#03081A" stop-opacity="0"/><stop offset="1" stop-color="#03081A" stop-opacity=".92"/></linearGradient></defs>')
def text(x, y, v, size, fill, family='Anton', extra=''):
return f'<text x="{x}" y="{y}" font-family="{family}" font-size="{size}" fill="{fill}" {extra}>{v}</text>'
def overlay(name, body):
src = OUT / f'{name}.svg'
src.write_text(f'<svg xmlns="http://www.w3.org/2000/svg" width="{W}" height="{H}" viewBox="0 0 {W} {H}">{DEFS}{body}</svg>')
subprocess.run(['vectorcraft-cli', 'convert', str(src), str(src.with_suffix('.png'))], check=True, stdout=subprocess.DEVNULL)
return Image.open(src.with_suffix('.png')).convert('RGBA')
def lit(scene, layer, glow=14):
"""Adds a layer with a soft glow, as a lit sign would have."""
halo = Image.new('RGBA', layer.size, (255, 196, 90, 0)); halo.putalpha(layer.getchannel('A').filter(ImageFilter.GaussianBlur(glow)).point(lambda a: int(a * .75)))
scene.paste(Image.alpha_composite(scene.convert('RGBA'), halo).convert('RGB')); scene.paste(layer, (0, 0), layer)
def fill_polygon(scene, points, colour, feather=5):
mask = Image.new('L', scene.size, 0); ImageDraw.Draw(mask).polygon(points, fill=255); mask = mask.filter(ImageFilter.GaussianBlur(feather))
scene.paste(Image.new('RGB', scene.size, colour), (0, 0), mask)
def clear_board(scene, box, limit, radius=26):
"""Takes the letters off a marquee board by spreading the lit board over them."""
area = scene.crop(box)
clean = area.convert('L').point(lambda v: 255 if v > 205 else 0).filter(ImageFilter.MinFilter(7))
black = Image.new('RGB', area.size)
glow = Image.composite(area, black, clean).filter(ImageFilter.GaussianBlur(radius)).load()
weight = clean.filter(ImageFilter.GaussianBlur(radius)).load()
out = area.copy(); px = out.load(); keep = clean.load()
for y in range(area.height):
for x in range(area.width):
if keep[x, y] == 0:
w = max(weight[x, y], 1) / 255
px[x, y] = tuple(min(255, int(c / w)) for c in glow[x, y])
soft = clean.filter(ImageFilter.GaussianBlur(1.5))
only = Image.new('L', area.size, 0); ImageDraw.Draw(only).polygon([(x - box[0], y - box[1]) for x, y in limit], fill=255)
scene.paste(Image.composite(area, out, soft), box[:2], only.filter(ImageFilter.GaussianBlur(2)))
def perspective(to, source):
"""Coefficients for Image.transform: to is the target's corners, source the picture's."""
rows, right = [], []
for (x, y), (u, v) in zip(to, source):
rows += [[x, y, 1, 0, 0, 0, -u * x, -u * y], [0, 0, 0, x, y, 1, -v * x, -v * y]]; right += [u, v]
n = 8
a = [r[:] + [b] for r, b in zip(rows, right)]
for i in range(n):
p = max(range(i, n), key=lambda r: abs(a[r][i])); a[i], a[p] = a[p], a[i]
for r in range(n):
if r != i:
f = a[r][i] / a[i][i]
a[r] = [c - f * d for c, d in zip(a[r], a[i])]
return [a[i][n] / a[i][i] for i in range(n)]
def mark(x, y, s, ring):
return f'<g transform="translate({x},{y}) scale({s})"><path d="{CRESCENT}" fill="url(#silver)"/><path d="{RING}" fill="none" stroke="{ring}" stroke-width="13"/><circle cx="430" cy="282" r="10" fill="{ring}"/></g>'
def logo(mx, my, ms, x, orbit_y, orbit_size, word_y, word_size):
return mark(mx, my, ms, '#F2C14E') + text(x + 4, orbit_y, 'ORBIT', orbit_size, '#F5F7FF', 'Barlow', f'font-weight="600" letter-spacing="{orbit_size * .36:.0f}"') + text(x, word_y, 'DRIVE-IN', word_size, 'url(#gold)', 'Anton', 'letter-spacing="3"')
def board(cx, y1, s1, y2, s2, y3, s3, dash):
ink, pink = '#2A1238', '#C2358F'
return (text(cx, y1, 'TONIGHT AT THE DRIVE-IN', s1, ink, 'Anton', 'text-anchor="middle" letter-spacing="2"') +
text(cx, y2, 'ORBIT TRIPLE BILL', s2, ink, 'Barlow', 'font-weight="600" text-anchor="middle" letter-spacing="3"') + f'<path d="M{cx - dash} {y2 - s2 * .35:.0f}h{dash * .3:.0f}M{cx + dash} {y2 - s2 * .35:.0f}h{-dash * .3:.0f}" stroke="{pink}" stroke-width="4"/>' +
text(cx, y3, 'THE &#39;BURBS • [REC]&#178; • DOG SOLDIERS', s3, ink, 'Barlow', 'font-weight="600" text-anchor="middle" letter-spacing="1"'))
def strip():
rows = [('TONIGHT', 'Orbit Marquee', '21:30', True), ('FRIDAY', 'Orbit Double Bill', '20:00', False), ('SATURDAY', 'Orbit Triple Bill', '19:00', False), ('LATE', 'The Late Show', '23:00', False)]
out = f'<rect y="880" width="{W}" height="200" fill="url(#scrim)"/>'
for i, (day, name, at, on) in enumerate(rows):
x = 40 + i * 465
stroke = '' if on else 'stroke="#C98A1E" stroke-width="2"'
out += f'<rect x="{x}" y="944" width="445" height="84" rx="8" fill="{"#FFD23F" if on else "#0E2147"}" {stroke}/>'
ink, sub = ('#071632', '#071632') if on else ('#F5F7FF', '#F2C14E')
out += text(x + 20, 974, day, 19, sub, 'Barlow', 'font-weight="600" letter-spacing="3"') + text(x + 20, 1012, name, 30, ink, 'Barlow', 'font-weight="600"') + text(x + 425, 1002, at, 34, ink, 'Barlow Condensed', 'text-anchor="end"')
for x, hint in ((40, 'OK Get your ticket'), (300, '▲▼ ◄► Choose an event'), (620, 'Back Leave')):
out += text(x, 1062, hint, 22, '#D5DCEA', 'Barlow')
return out
def theatre():
source = Image.open(HERE / 'references/paul-theatre.png').convert('RGB').crop((8, 0, 1514, 847)).resize((W, H), Image.LANCZOS)
fill_polygon(source, [(592, 88), (1211, 88), (1211, 50), (1331, 50), (1331, 347), (592, 347)], (20, 14, 32), 3)
fill_polygon(source, [(1325, 130), (1348, 130), (1348, 186), (1325, 186)], (20, 14, 32), 3)
top = [(x, 377 + ((x - 968) / 430) ** 2 * 12) for x in range(540, 1401, 40)]
clear_board(source, (540, 372, 1400, 562), top + [(1400, 562), (540, 562)])
return source
def drive_in(picture=None):
full = Image.open(HERE / 'references/paul-drive-in.png').convert('RGB')
# The app's Edit and share buttons in the screenshot go under pavement copied from beside them.
for box, to in (((280, 222, 332, 266), (20, 222)), ((390, 226, 430, 266), (436, 226))):
patch = full.crop(box); soft = Image.new('L', patch.size, 0); ImageDraw.Draw(soft).rectangle((3, 3, patch.width - 4, patch.height - 4), fill=255)
full.paste(patch, to, soft.filter(ImageFilter.GaussianBlur(2)))
source = full.crop((12, 7, 482, 271)).resize((W, H), Image.LANCZOS).filter(ImageFilter.UnsharpMask(3, 60, 2))
fill_polygon(source, [(511, 148), (800, 148), (925, 176), (970, 200), (970, 348), (511, 348)], (22, 14, 36), 3)
fill_polygon(source, [(966, 204), (996, 204), (996, 244), (966, 244)], (22, 14, 36), 3)
clear_board(source, (470, 366, 1050, 534), [(470, 372), (620, 366), (764, 366), (1040, 392), (1040, 532), (764, 522), (470, 508)], 20)
corners = [(1338, 340), (1887, 262), (1892, 602), (1338, 606)]
if picture:
art = Image.open(picture).convert('RGB')
placed = art.transform((W, H), Image.PERSPECTIVE, perspective(corners, [(0, 0), (art.width, 0), (art.width, art.height), (0, art.height)]), Image.BICUBIC)
mask = Image.new('L', (W, H), 0); ImageDraw.Draw(mask).polygon(corners, fill=255)
source.paste(placed, (0, 0), mask.filter(ImageFilter.GaussianBlur(1.5)))
else:
fill_polygon(source, corners, (12, 10, 26), 2)
return source
OUT = Path(sys.argv[1]) if len(sys.argv) > 1 else HERE
picture = sys.argv[2] if len(sys.argv) > 2 else None
if picture:
scene = theatre()
lit(scene, overlay('t_logo', logo(600, 92, .42, 824, 168, 34, 302, 136)))
scene.paste(l := overlay('t_board', board(968, 444, 62, 498, 40, 546, 36, 330)), (0, 0), l)
scene.paste(l := overlay('t_strip', strip()), (0, 0), l)
scene.save(OUT / 'di_theatre.jpg', quality=88)
scene = drive_in(picture)
lit(scene, overlay('d_logo', logo(494, 158, .3, 642, 216, 25, 322, 96)), 9)
scene.paste(l := overlay('d_board', board(764, 430, 50, 472, 28, 506, 24, 250)), (0, 0), l)
scene.paste(l := overlay('d_strip', strip()), (0, 0), l)
scene.save(OUT / 'di_drivein.jpg', quality=88)
else:
theatre().save(HERE / 'theatre_blank.webp', quality=88)
drive_in().save(HERE / 'drive_in_blank.webp', quality=88)
Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 949 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB