INNER CODE UNIT · Python

y

utopia-rise/godot-jvm · logo/export.py:264

    y = CANVAS_H // 2 - text_height // 2 + TEXT_Y
    for gap, layer in rows:
        y += gap
        bg.alpha_composite(layer, (text_x - layer.width // 2, y))
        y += layer.height

    rgb = bg.convert('RGB')
    rgb.save(STORE / f'{name}.png')
    webp = STORE / f'{name}.webp'
    for quality in (92, 88, 84, 80, 75, 70):
        rgb.save(webp, quality=quality, method=6)
        if webp.stat().st_size <= WEBP_MAX_BYTES:
            break
    print(f'Rendered store/{webp.name} ({webp.stat().st_size // 1024} KB at quality {quality})')

def render_store_images():
    logo_path = HIGHRES / 'logo-1024.png'
    missing = [p for p in [logo_path] + [LANGUAGE / f'{name}.png' for name, _ in LANGUAGES] if not p.is_file()]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…