- Generate 18 classic eye variants in 3 styles (realistic, anime, cartoon) with 6 colors each (blue, green, brown, hazel, grey, amber) - Add scripts for generating, converting, and importing eyes: - generate_classic_eyes_ppm.py: Generate PPM images (no dependencies) - download_classic_eyes.py: Full-featured generator with PIL - startup_import_eyes.py: Import eyes on backend startup - import_saved_eyes.py: Import from saved directory - Update docker-compose to mount scripts directory - Include metadata.json for tracking eye properties
12 lines
349 B
Python
12 lines
349 B
Python
#!/usr/bin/env python3
|
|
"""Convert PPM files to PNG using PIL."""
|
|
from pathlib import Path
|
|
from PIL import Image
|
|
|
|
ppm_dir = Path(__file__).parent
|
|
for ppm_file in ppm_dir.glob("*.ppm"):
|
|
png_file = ppm_file.with_suffix('.png')
|
|
img = Image.open(ppm_file)
|
|
img.save(png_file, 'PNG')
|
|
print(f"Converted: {ppm_file.name} -> {png_file.name}")
|