import math import numpy as np from PIL import Image, ImageDraw, ImageFilter SIZE = 1024 CENTER = SIZE / 2.0 # 1. Background: Majestic cosmic void with vibrant nebula, stellar dust, and lens flares bg = Image.new('RGBA', (SIZE, SIZE), (2, 4, 15, 255)) bdraw = ImageDraw.Draw(bg) # Rich star clusters np.random.seed(333) tints = [(255, 255, 255), (200, 230, 255), (255, 235, 180)] for _ in range(600): x = np.random.randint(0, SIZE) y = np.random.randint(0, SIZE) br = np.random.randint(120, 255) sz = int(np.random.choice([1, 1, 2, 2, 3, 4], p=[0.6, 0.25, 0.1, 0.03, 0.015, 0.005])) t_idx = np.random.randint(0, len(tints)) tint = tints[t_idx] bdraw.ellipse([x, y, x + sz, y + sz], fill=tint + (br,)) # Vivid cosmic nebula clouds (violet, turquoise, deep indigo) neb = Image.new('RGBA', (SIZE, SIZE), (0, 0, 0, 0)) ndraw = ImageDraw.Draw(neb) ndraw.ellipse([80, 60, 940, 920], fill=(45, 15, 75, 110)) # Deep cosmic violet ndraw.ellipse([180, 220, 840, 800], fill=(10, 60, 110, 120)) # Turquoise astral dust ndraw.ellipse([300, 280, 720, 740], fill=(95, 45, 15, 90)) # Golden solar core neb = neb.filter(ImageFilter.GaussianBlur(85)) bg = Image.alpha_composite(bg, neb) # 2. EXACT 13-POINTED STAR (ТРИДЕКАГРАММА) С ПЛАВНЫМИ СВЕТОВЫМИ ЛЕПЕСТКАМИ N_POINTS = 13 R_TIP = SIZE * 0.465 R_INNER = SIZE * 0.285 R_MEDALLION = SIZE * 0.26 R_CORE = SIZE * 0.095 start_angle = -math.pi / 2.0 # Верхний 13-й луч строго на 12 часов tips = [] valleys = [] for i in range(N_POINTS): ang_tip = start_angle + i * (2.0 * math.pi / N_POINTS) ang_val = ang_tip + (math.pi / N_POINTS) tips.append((CENTER + R_TIP * math.cos(ang_tip), CENTER + R_TIP * math.sin(ang_tip))) valleys.append((CENTER + R_INNER * math.cos(ang_val), CENTER + R_INNER * math.sin(ang_val))) star_layer = Image.new('RGBA', (SIZE, SIZE), (0, 0, 0, 0)) sdraw = ImageDraw.Draw(star_layer) GOLD_CORE = (255, 255, 240, 255) GOLD_BRIGHT = (255, 228, 120, 245) GOLD_AURA = (240, 160, 30, 95) CYAN_ENERGY = (80, 220, 255, 180) # Petal rays with smooth curvature 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 = tips[i] 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)) # Smooth Bézier curvature on left and right borders of the ray ctrl_r = (R_TIP + R_INNER) * 0.49 p_ctrl_l = (CENTER + ctrl_r * math.cos((ang_tip + ang_vl)*0.5 + 0.02), CENTER + ctrl_r * math.sin((ang_tip + ang_vl)*0.5 + 0.02)) p_ctrl_r = (CENTER + ctrl_r * math.cos((ang_tip + ang_vr)*0.5 - 0.02), CENTER + ctrl_r * math.sin((ang_tip + ang_vr)*0.5 - 0.02)) pts_l = [((1-t)**2 * p_vl[0] + 2*(1-t)*t * p_ctrl_l[0] + t**2 * p_tip[0], (1-t)**2 * p_vl[1] + 2*(1-t)*t * p_ctrl_l[1] + t**2 * p_tip[1]) for t in np.linspace(0, 1, 28)] pts_r = [((1-t)**2 * p_tip[0] + 2*(1-t)*t * p_ctrl_r[0] + t**2 * p_vr[0], (1-t)**2 * p_tip[1] + 2*(1-t)*t * p_ctrl_r[1] + t**2 * p_vr[1]) for t in np.linspace(0, 1, 28)] poly = [(CENTER, CENTER)] + pts_l + pts_r sdraw.polygon(poly, fill=(50, 32, 12, 130)) # Glowing photon edges for edge in [pts_l, pts_r]: for p in range(len(edge) - 1): sdraw.line([edge[p], edge[p+1]], fill=GOLD_AURA, width=7) sdraw.line([edge[p], edge[p+1]], fill=GOLD_BRIGHT, width=3) sdraw.line([edge[p], edge[p+1]], fill=GOLD_CORE, width=1) # Center spine line sdraw.line([CENTER, CENTER, p_tip[0], p_tip[1]], fill=GOLD_CORE, width=2) # Diamond star spark at the tip of each of the 13 rays for spark_len, spark_w in [(12, 3), (6, 1)]: sdraw.line([p_tip[0] - spark_len, p_tip[1], p_tip[0] + spark_len, p_tip[1]], fill=GOLD_CORE, width=spark_w) sdraw.line([p_tip[0], p_tip[1] - spark_len, p_tip[0], p_tip[1] + spark_len], fill=GOLD_CORE, width=spark_w) # 3. Inner Medallion: Magic Portal & Astral Rings med_layer = Image.new('RGBA', (SIZE, SIZE), (0, 0, 0, 0)) mdraw = ImageDraw.Draw(med_layer) # Obsidian space mirror with cyan-gold corona mdraw.ellipse([CENTER - R_MEDALLION, CENTER - R_MEDALLION, CENTER + R_MEDALLION, CENTER + R_MEDALLION], fill=(5, 8, 24, 250), outline=GOLD_BRIGHT, width=4) mdraw.ellipse([CENTER - R_MEDALLION - 3, CENTER - R_MEDALLION - 3, CENTER + R_MEDALLION + 3, CENTER + R_MEDALLION + 3], outline=CYAN_ENERGY, width=2) mdraw.ellipse([CENTER - R_MEDALLION + 6, CENTER - R_MEDALLION + 6, CENTER + R_MEDALLION - 6, CENTER + R_MEDALLION - 6], outline=(255, 230, 140, 180), width=1) # Magic stardust ring (36 luminous dots around medallion rim) for d in range(36): d_ang = d * (2 * math.pi / 36.0) dr = R_MEDALLION - 10 dx = CENTER + dr * math.cos(d_ang) dy = CENTER + dr * math.sin(d_ang) dot_sz = 2 if d % 3 == 0 else 1 mdraw.ellipse([dx - dot_sz, dy - dot_sz, dx + dot_sz, dy + dot_sz], fill=GOLD_CORE) # 4. CHROME TRISKELION: ЭНЕРГЕТИЧЕСКИЙ ВИХРЬ 3 ДЕВЯТОК С СВЕТОВЫМИ ХВОСТАМИ # Center circle (The eye of the portal) mdraw.ellipse([CENTER - R_CORE, CENTER - R_CORE, CENTER + R_CORE, CENTER + R_CORE], fill=(2, 4, 14, 255), outline=GOLD_BRIGHT, width=5) mdraw.ellipse([CENTER - R_CORE + 4, CENTER - R_CORE + 4, CENTER + R_CORE - 4, CENTER + R_CORE - 4], outline=CYAN_ENERGY, width=2) # 3 Chrome fluid spiral arms for k in range(3): rot = start_angle + k * (2.0 * math.pi / 3.0) outer = [] inner = [] steps = 65 for s in range(steps + 1): t = s / float(steps) t_curv = 0.5 * (1.0 - math.cos(t * math.pi)) cr = R_CORE + t_curv * (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) * 16.0 ir = max(R_CORE, cr - thick) inner.append((CENTER + ir * math.cos(ca + 0.08), CENTER + ir * math.sin(ca + 0.08))) ribbon = outer + inner[::-1] mdraw.polygon(ribbon, fill=(240, 175, 40, 150)) # Glowing filaments along outer edge for p in range(len(outer) - 1): mdraw.line([outer[p], outer[p+1]], fill=GOLD_AURA, width=6) mdraw.line([outer[p], outer[p+1]], fill=GOLD_CORE, width=2) for p in range(len(inner) - 1): mdraw.line([inner[p], inner[p+1]], fill=CYAN_ENERGY, width=2) # Magic spark at the tip of each nine's tail tip_p = outer[-1] for s_len, s_w in [(9, 2), (4, 1)]: mdraw.line([tip_p[0] - s_len, tip_p[1], tip_p[0] + s_len, tip_p[1]], fill=GOLD_CORE, width=s_w) mdraw.line([tip_p[0], tip_p[1] - s_len, tip_p[0], tip_p[1] + s_len], fill=GOLD_CORE, width=s_w) # Central Singularity / Star of Truth (4-point micro-spark in center of eye) for l, w in [(18, 3), (8, 1)]: mdraw.line([CENTER - l, CENTER, CENTER + l, CENTER], fill=GOLD_CORE, width=w) mdraw.line([CENTER, CENTER - l, CENTER, CENTER + l], fill=GOLD_CORE, width=w) # 5. Optical Bloom and Anamorphic Lens Flare comp = Image.alpha_composite(bg, star_layer) comp = Image.alpha_composite(comp, med_layer) bloom_soft = comp.filter(ImageFilter.GaussianBlur(16)) bloom_sharp = comp.filter(ImageFilter.GaussianBlur(5)) comp = Image.blend(comp, bloom_soft, 0.22) final_img = Image.blend(comp, bloom_sharp, 0.20) out_file = '/home/alexives/.gemini/antigravity-ide/brain/4ff924d9-3d7f-4202-9066-3ac5c3088b8e/star_13_cosmic_magic_gold.png' final_img.save(out_file, 'PNG') print("Successfully generated COSMIC MAGIC 13-POINTED STAR at", out_file)