import math import numpy as np from PIL import Image, ImageDraw, ImageFilter SIZE = 1024 CENTER = SIZE / 2.0 bg = Image.new('RGBA', (SIZE, SIZE), (2, 3, 12, 255)) bdraw = ImageDraw.Draw(bg) np.random.seed(555) for _ in range(400): x = np.random.randint(0, SIZE) y = np.random.randint(0, SIZE) br = np.random.randint(140, 255) sz = np.random.choice([1, 1, 2, 2, 3], p=[0.7, 0.2, 0.07, 0.02, 0.01]) bdraw.ellipse([x, y, x + sz, y + sz], fill=(br, br, 255, br)) # Deep cosmic background neb = Image.new('RGBA', (SIZE, SIZE), (0, 0, 0, 0)) ndraw = ImageDraw.Draw(neb) ndraw.ellipse([160, 140, 860, 840], fill=(25, 20, 60, 85)) ndraw.ellipse([260, 260, 760, 760], fill=(50, 35, 15, 75)) neb = neb.filter(ImageFilter.GaussianBlur(90)) bg = Image.alpha_composite(bg, neb) N_POINTS = 13 R_TIP = SIZE * 0.46 R_INNER = SIZE * 0.28 R_MEDALLION = SIZE * 0.255 R_CORE = SIZE * 0.09 start_angle = -math.pi / 2.0 GOLD_WHITE = (255, 255, 235, 255) GOLD_LIGHT = (255, 220, 100, 240) GOLD_WARM = (220, 160, 35, 180) GOLD_AURA = (190, 130, 20, 70) star_layer = Image.new('RGBA', (SIZE, SIZE), (0, 0, 0, 0)) sdraw = ImageDraw.Draw(star_layer) # Draw 13 smooth arched flame/lotus petals for i in range(N_POINTS): ang_tip = start_angle + i * (2.0 * math.pi / N_POINTS) ang_vl = ang_tip - (math.pi / N_POINTS) ang_vr = ang_tip + (math.pi / N_POINTS) p_tip = (CENTER + R_TIP * math.cos(ang_tip), CENTER + R_TIP * math.sin(ang_tip)) p_vl = (CENTER + R_INNER * math.cos(ang_vl), CENTER + R_INNER * math.sin(ang_vl)) p_vr = (CENTER + R_INNER * math.cos(ang_vr), CENTER + R_INNER * math.sin(ang_vr)) # Left edge: soft S-curve / flowing wave pts_l = [] for s in range(35): t = s / 34.0 r = R_INNER + t * (R_TIP - R_INNER) # Smooth organic curvature a = ang_vl + t * (ang_tip - ang_vl) + math.sin(t * math.pi) * 0.05 pts_l.append((CENTER + r * math.cos(a), CENTER + r * math.sin(a))) pts_r = [] for s in range(35): t = s / 34.0 r = R_TIP - t * (R_TIP - R_INNER) a = ang_tip + t * (ang_vr - ang_tip) - math.sin(t * math.pi) * 0.05 pts_r.append((CENTER + r * math.cos(a), CENTER + r * math.sin(a))) poly = [(CENTER, CENTER)] + pts_l + pts_r sdraw.polygon(poly, fill=(40, 28, 10, 110)) # Glow edge for p in range(len(pts_l) - 1): sdraw.line([pts_l[p], pts_l[p+1]], fill=GOLD_AURA, width=6) sdraw.line([pts_l[p], pts_l[p+1]], fill=GOLD_LIGHT, width=2) for p in range(len(pts_r) - 1): sdraw.line([pts_r[p], pts_r[p+1]], fill=GOLD_AURA, width=6) sdraw.line([pts_r[p], pts_r[p+1]], fill=GOLD_LIGHT, width=2) # Flowing center rib for s in range(25): t = s / 24.0 r = R_INNER * 0.95 + t * (R_TIP - R_INNER * 0.95) a = ang_tip + math.sin(t * math.pi * 1.5) * 0.015 sdraw.ellipse([CENTER + r*math.cos(a)-1, CENTER + r*math.sin(a)-1, CENTER + r*math.cos(a)+1, CENTER + r*math.sin(a)+1], fill=GOLD_WHITE) med_layer = Image.new('RGBA', (SIZE, SIZE), (0, 0, 0, 0)) mdraw = ImageDraw.Draw(med_layer) mdraw.ellipse([CENTER - R_MEDALLION, CENTER - R_MEDALLION, CENTER + R_MEDALLION, CENTER + R_MEDALLION], fill=(5, 7, 18, 250), outline=GOLD_WARM, width=3) mdraw.ellipse([CENTER - R_MEDALLION + 5, CENTER - R_MEDALLION + 5, CENTER + R_MEDALLION - 5, CENTER + R_MEDALLION - 5], outline=GOLD_LIGHT, width=1) # Central circle mdraw.ellipse([CENTER - R_CORE, CENTER - R_CORE, CENTER + R_CORE, CENTER + R_CORE], fill=(2, 4, 12, 255), outline=GOLD_WARM, width=4) mdraw.ellipse([CENTER - R_CORE + 4, CENTER - R_CORE + 4, CENTER + R_CORE - 4, CENTER + R_CORE - 4], outline=GOLD_WHITE, width=1) # 3 Chrome fluid spiral arms (graceful vortex) for k in range(3): rot = start_angle + k * (2.0 * math.pi / 3.0) outer = [] inner = [] steps = 60 for s in range(steps + 1): t = s / float(steps) # Smooth spiral cr = R_CORE + (t ** 1.15) * (R_MEDALLION - R_CORE - 10) ca = rot + t * 1.48 bx = CENTER + cr * math.cos(ca) by = CENTER + cr * math.sin(ca) outer.append((bx, by)) thick = math.sin(t * math.pi) * 14.0 ir = max(R_CORE, cr - thick) inner.append((CENTER + ir * math.cos(ca + 0.07), CENTER + ir * math.sin(ca + 0.07))) mdraw.polygon(outer + inner[::-1], fill=(210, 150, 25, 140)) for p in range(len(outer) - 1): mdraw.line([outer[p], outer[p+1]], fill=GOLD_WHITE, width=2) for p in range(len(inner) - 1): mdraw.line([inner[p], inner[p+1]], fill=GOLD_WARM, width=1) comp = Image.alpha_composite(bg, star_layer) comp = Image.alpha_composite(comp, med_layer) bloom = comp.filter(ImageFilter.GaussianBlur(8)) final_img = Image.blend(comp, bloom, 0.25) out_file = '/home/alexives/.gemini/antigravity-ide/brain/4ff924d9-3d7f-4202-9066-3ac5c3088b8e/star_13_flowing_lotus_vortex.png' final_img.save(out_file, 'PNG') print("Rendered flowing lotus vortex to", out_file)