import os from PIL import Image, ImageFilter, ImageEnhance def process_dreamy_intro(): # Paths base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) src_dir = os.path.join(base_dir, 'assets', 'references', 'intro_shots') out_dir = os.path.join(base_dir, 'assets', 'images', 'intro_sequence') if not os.path.exists(src_dir): print(f"Error: Source directory not found: {src_dir}") return if not os.path.exists(out_dir): os.makedirs(out_dir) print(f"Created output directory: {out_dir}") # List of key images to process target_files = [ 'otac_longboard_pier.png', 'birthday_cake_rd.png', 'kai_first_dreads_family.png', 'ana_barbershop_dreads.png', 'zombie_silhouettes_panic.png', 'chaos_streets_apocalypse.png', 'parents_transparent_ghosts.png', 'family_portrait_complete.png' ] print("--- 🌫️ CREATING DREAMY FILTER VERSIONS 🌫️ ---") for filename in target_files: src_path = os.path.join(src_dir, filename) if not os.path.exists(src_path): print(f"⚠️ Missing: {filename}") continue try: # Load Clean Image img = Image.open(src_path).convert('RGB') # 1. Save Clean Version (Optimized/Resized if needed, but keeping original size for now) clean_name = filename.replace('.png', '_clean.png') clean_path = os.path.join(out_dir, clean_name) img.save(clean_path) print(f"✅ Saved Clean: {clean_name}") # 2. Create Dreamy/Blur Version # Effect: Gaussian Blur + slightly increased Brightness (bloom effect) blur_img = img.filter(ImageFilter.GaussianBlur(radius=15)) # Add "Bloom" (Brighten light areas) enhancer = ImageEnhance.Brightness(blur_img) blur_img = enhancer.enhance(1.2) # Add slight saturation decrease for "fade" look? # sat_enhancer = ImageEnhance.Color(blur_img) # blur_img = sat_enhancer.enhance(0.8) blur_name = filename.replace('.png', '_dreamy.png') blur_path = os.path.join(out_dir, blur_name) blur_img.save(blur_path) print(f"🌫️ Saved Dreamy: {blur_name}") except Exception as e: print(f"❌ Error processing {filename}: {e}") print("--- DONE ---") print(f"Images are ready in: {out_dir}") if __name__ == "__main__": process_dreamy_intro()