1"""Rasterize the app mark; requires Pillow. AGPL-3.0-or-later."""2from pathlib import Path3from PIL import Image, ImageDraw4root = Path(__file__).resolve().parent.parent5S = 4 # supersample for smooth edges6for n in [192, 512]:7 big = n * S8 im = Image.new('RGBA', (big, big), (0, 0, 0, 0))9 d = ImageDraw.Draw(im)10 k = big / 51211 d.rounded_rectangle([0, 0, big - 1, big - 1], radius=round(112 * k), fill='#1a1a1a')12 trap = [(182, 128), (330, 128), (370, 384), (142, 384)]13 d.line([(x * k, y * k) for x, y in trap + trap[:2]], fill='#5e5e5e', width=round(22 * k), joint='curve')14 d.rounded_rectangle([168 * k, 128 * k, 344 * k, 384 * k], radius=round(10 * k), outline='#f0c04a', width=round(26 * k))15 im = im.resize((n, n), Image.LANCZOS)16 im.save(root / f'assets/icon-{n}.png')