INNER CODE UNIT · Python

logo_width

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

    logo_width = int(logo.width * LOGO_HEIGHT / logo.height)
    start = (CANVAS_W - (logo_width + LOGO_TEXT_GAP + text_width)) // 2
    logo_x = start + logo_width // 2
    bg = background(logo_x, HEAD_Y)
    paste_logo(bg, logo, head_center, logo_x, HEAD_Y)
    text_x = start + logo_width + LOGO_TEXT_GAP + text_width // 2
    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:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…