INNER CODE UNIT · Python

logo

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

    logo = logo.resize((int(logo.width * LOGO_HEIGHT / logo.height), LOGO_HEIGHT), Image.Resampling.LANCZOS)
    y -= int((head_center - 0.5) * LOGO_HEIGHT)
    shadow = Image.new('RGBA', (logo.width + 200, logo.height + 200), (0, 0, 0, 0))
    tint = Image.new('RGBA', logo.size, (5, 3, 20, 190))
    tint.putalpha(logo.getchannel('A'))
    shadow.alpha_composite(tint, (100, 130))
    shadow = shadow.filter(ImageFilter.GaussianBlur(40))
    bg.alpha_composite(shadow, (x - shadow.width // 2, y - shadow.height // 2))
    bg.alpha_composite(logo, (x - logo.width // 2, y - logo.height // 2))

def compose(logo, head_center, rows, text_width, name):
    """Mascot on the left, a column of centered rows on the right, the pair centered on the canvas.
    `rows` holds (gap above, layer) pairs; `text_width` is the column width, shared between images
    so the mascot lands at the same spot in each."""
    text_height = sum(gap + layer.height for gap, layer in rows)
    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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…