diff --git a/design/drive-in/build-drive-in.py b/design/drive-in/build-drive-in.py
index b83b2ce1..38189344 100644
--- a/design/drive-in/build-drive-in.py
+++ b/design/drive-in/build-drive-in.py
@@ -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 = (''
''
'')
-def oldcar(x, y, s):
- return f''
-def post(x):
- return f''
-def drivein():
- towers = ''
- for x in (150, 950):
- towers += f''
- seams = ''.join(f'' for x in range(183, 1150, 139))
- return ('' + stars + towers + '' + seams +
- '' + picture(84, 104, 1032, 580) +
- '' + text(600, 730, 'ORBIT DRIVE-IN THEATRE', 34, '#0B1F47', 'Barlow Condensed', 'text-anchor="middle" letter-spacing="8"') +
- '' + oldcar(40, 860, 1) + post(490) + oldcar(560, 866, .96) + post(990) + SIDE + HINTS)
-def cinema():
- doors = ''.join(f'' for x in (110, 280, 770, 940))
- canopy = ''
- 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 += '' + 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 = '' + text(600, 916, 'TICKETS', 34, '#F2C14E', 'Barlow Condensed', 'text-anchor="middle" letter-spacing="5"')
- pil = ''.join(f'' for x in (70, 96, 122, 1078, 1104, 1130))
- return ('' + stars + '' + pil +
- '' + bulbs(210, 62, 780, 428, 40, 4.5) + picture(240, 92, 720, 368, 26) +
- doors + booth + canopy + '' + SIDE + HINTS)
def crt():
grille = ''.join(f'' for y in range(520, 770, 18))
lines = ''.join(f'' for y in range(136, 806, 6))
@@ -115,5 +92,4 @@ def crt():
picture(136, 136, 748, 668, 42, 'crt') + f'{lines}' +
'' + dial(218) + dial(366) + grille + text(1019, 796, 'ORBIT', 26, '#F5F1E0', 'Barlow', 'font-weight="600" text-anchor="middle" letter-spacing="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())
diff --git a/design/drive-in/build-scenes.py b/design/drive-in/build-scenes.py
new file mode 100644
index 00000000..2c04b1b1
--- /dev/null
+++ b/design/drive-in/build-scenes.py
@@ -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 = (''
+ ''
+ '')
+def text(x, y, v, size, fill, family='Anton', extra=''):
+ return f'{v}'
+def overlay(name, body):
+ src = OUT / f'{name}.svg'
+ src.write_text(f'')
+ 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''
+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'' +
+ text(cx, y3, 'THE 'BURBS • [REC]² • 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''
+ for i, (day, name, at, on) in enumerate(rows):
+ x = 40 + i * 465
+ stroke = '' if on else 'stroke="#C98A1E" stroke-width="2"'
+ out += f''
+ 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)
diff --git a/design/drive-in/drive_in_blank.webp b/design/drive-in/drive_in_blank.webp
new file mode 100644
index 00000000..1be9ac59
Binary files /dev/null and b/design/drive-in/drive_in_blank.webp differ
diff --git a/design/drive-in/drive_in_screen_cinema.png b/design/drive-in/drive_in_screen_cinema.png
deleted file mode 100644
index 072ddb7a..00000000
Binary files a/design/drive-in/drive_in_screen_cinema.png and /dev/null differ
diff --git a/design/drive-in/drive_in_screen_cinema.svg b/design/drive-in/drive_in_screen_cinema.svg
deleted file mode 100644
index 457d31a6..00000000
--- a/design/drive-in/drive_in_screen_cinema.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/design/drive-in/drive_in_screen_crt.png b/design/drive-in/drive_in_screen_crt.png
index cc432aaa..fd68ca24 100644
Binary files a/design/drive-in/drive_in_screen_crt.png and b/design/drive-in/drive_in_screen_crt.png differ
diff --git a/design/drive-in/drive_in_screen_crt.svg b/design/drive-in/drive_in_screen_crt.svg
index b7d82a98..16ab5b7a 100644
--- a/design/drive-in/drive_in_screen_crt.svg
+++ b/design/drive-in/drive_in_screen_crt.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/design/drive-in/drive_in_screen_lot.png b/design/drive-in/drive_in_screen_lot.png
deleted file mode 100644
index 28e66033..00000000
Binary files a/design/drive-in/drive_in_screen_lot.png and /dev/null differ
diff --git a/design/drive-in/drive_in_screen_lot.svg b/design/drive-in/drive_in_screen_lot.svg
deleted file mode 100644
index 674b451d..00000000
--- a/design/drive-in/drive_in_screen_lot.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/design/drive-in/references/paul-drive-in.png b/design/drive-in/references/paul-drive-in.png
new file mode 100644
index 00000000..9cf05b65
Binary files /dev/null and b/design/drive-in/references/paul-drive-in.png differ
diff --git a/design/drive-in/references/paul-theatre.png b/design/drive-in/references/paul-theatre.png
new file mode 100644
index 00000000..18427953
Binary files /dev/null and b/design/drive-in/references/paul-theatre.png differ
diff --git a/design/drive-in/theatre_blank.webp b/design/drive-in/theatre_blank.webp
new file mode 100644
index 00000000..ed8829b1
Binary files /dev/null and b/design/drive-in/theatre_blank.webp differ