Files
999/scripts/make_luminous_variant.py
T

41 lines
2.0 KiB
Python

from PIL import Image, ImageEnhance, ImageFilter
import numpy as np
# Load Option B
src = Image.open('/home/alexives/.gemini/antigravity-ide/brain/4ff924d9-3d7f-4202-9066-3ac5c3088b8e/star_13_chrome_emblem_1791132648738.jpg').convert('RGBA')
arr = np.array(src, dtype=np.float32)
r, g, b = arr[:, :, 0], arr[:, :, 1], arr[:, :, 2]
lum = 0.299 * r + 0.587 * g + 0.114 * b
is_symbol = (lum > 45)
# Variant 1: Celestial Aurora & Astral Violet/Cyan light (Glowing energy, translucent)
# Map luminance to radiant plasma
norm_lum = np.clip(lum / 255.0, 0, 1)
# Core is brilliant white, midtones are cyan-electric-blue, shadows are deep indigo
r1 = np.where(is_symbol, np.clip(norm_lum**1.5 * 255 + (1 - norm_lum) * 30, 0, 255), r)
g1 = np.where(is_symbol, np.clip(norm_lum * 240 + (1 - norm_lum) * 120, 0, 255), g)
b1 = np.where(is_symbol, np.clip(norm_lum * 255 + (1 - norm_lum) * 220, 0, 255), b)
out1 = np.stack([r1, g1, b1, arr[:, :, 3]], axis=-1).astype(np.uint8)
img1 = Image.fromarray(out1)
# Add soft luminous glow
glow1 = img1.filter(ImageFilter.GaussianBlur(12))
img1_glowing = Image.blend(img1, glow1, 0.25)
img1_glowing.save('/home/alexives/.gemini/antigravity-ide/brain/4ff924d9-3d7f-4202-9066-3ac5c3088b8e/star_13_celestial_aurora_light.png', 'PNG')
# Variant 2: Ethereal White-Gold Starlight (Pure radiant energy, NOT yellow paint/metal)
# High highlights are dazzling white (255,255,255), warm subtle halo (255, 235, 180)
r2 = np.where(is_symbol, np.clip(norm_lum**0.8 * 255, 0, 255), r)
g2 = np.where(is_symbol, np.clip(norm_lum**0.9 * 248, 0, 255), g)
b2 = np.where(is_symbol, np.clip(norm_lum**1.1 * 220, 0, 255), b)
out2 = np.stack([r2, g2, b2, arr[:, :, 3]], axis=-1).astype(np.uint8)
img2 = Image.fromarray(out2)
glow2 = img2.filter(ImageFilter.GaussianBlur(10))
img2_glowing = Image.blend(img2, glow2, 0.2)
img2_glowing.save('/home/alexives/.gemini/antigravity-ide/brain/4ff924d9-3d7f-4202-9066-3ac5c3088b8e/star_13_ethereal_white_light.png', 'PNG')
print("Created celestial_aurora_light and ethereal_white_light")