TR
games/alis / tools / site / images.py · commit 9c722cf
import sys, globfrom PIL import Image, ImageDraw, ImageFontrun, out = sys.argv[1], sys.argv[2]def frame(n):    return Image.open(f'{run}/frame-{n:05d}.bmp').convert('RGB')def save(im, name, scale=2):    im.resize((im.width * scale, int(im.height * scale * 1.2)), Image.NEAREST).save(f'{out}/{name}')shots = {'flags.png': 650, 'title.png': 1250, 'credits.png': 1500, 'menu.png': 3200, 'jungle.png': 3700, 'walk.png': 4400}for name, n in shots.items():    save(frame(n), name)# og.png 1200x630: the jungle, the title in the cornerog = frame(3700).resize((1200, 720), Image.NEAREST).crop((0, 45, 1200, 675))title = frame(1250).resize((480, 300), Image.NEAREST)og.paste(title, (700, 320))og.save(f'{out}/og.png')og.resize((480, 252), Image.LANCZOS).save(f'{out}/thumbnail.png')frame(1250).crop((60, 40, 140, 120)).resize((64, 64), Image.NEAREST).save(f'{out}/favicon.png')print('images written')