🏗️ Clean demo asset filenames - remove timestamps

Renamed 45 files to remove timestamp suffixes
- kai_run_east_1_stylea_1767137189376.png → kai_run_east_1_stylea.png
- etc...

Creates clean, organized asset structure
Added organize_demo_assets.py script
This commit is contained in:
2025-12-31 00:54:18 +01:00
parent 4f0a430c42
commit df1334ad4d
46 changed files with 120 additions and 0 deletions

View File

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 373 KiB

View File

Before

Width:  |  Height:  |  Size: 537 KiB

After

Width:  |  Height:  |  Size: 537 KiB

View File

Before

Width:  |  Height:  |  Size: 472 KiB

After

Width:  |  Height:  |  Size: 472 KiB

View File

Before

Width:  |  Height:  |  Size: 616 KiB

After

Width:  |  Height:  |  Size: 616 KiB

View File

Before

Width:  |  Height:  |  Size: 548 KiB

After

Width:  |  Height:  |  Size: 548 KiB

View File

Before

Width:  |  Height:  |  Size: 719 KiB

After

Width:  |  Height:  |  Size: 719 KiB

View File

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 350 KiB

View File

Before

Width:  |  Height:  |  Size: 454 KiB

After

Width:  |  Height:  |  Size: 454 KiB

View File

Before

Width:  |  Height:  |  Size: 531 KiB

After

Width:  |  Height:  |  Size: 531 KiB

View File

Before

Width:  |  Height:  |  Size: 723 KiB

After

Width:  |  Height:  |  Size: 723 KiB

View File

Before

Width:  |  Height:  |  Size: 428 KiB

After

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 KiB

View File

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 456 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 KiB

View File

Before

Width:  |  Height:  |  Size: 430 KiB

After

Width:  |  Height:  |  Size: 430 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 KiB

View File

Before

Width:  |  Height:  |  Size: 472 KiB

After

Width:  |  Height:  |  Size: 472 KiB

View File

Before

Width:  |  Height:  |  Size: 439 KiB

After

Width:  |  Height:  |  Size: 439 KiB

View File

Before

Width:  |  Height:  |  Size: 368 KiB

After

Width:  |  Height:  |  Size: 368 KiB

View File

Before

Width:  |  Height:  |  Size: 405 KiB

After

Width:  |  Height:  |  Size: 405 KiB

View File

Before

Width:  |  Height:  |  Size: 366 KiB

After

Width:  |  Height:  |  Size: 366 KiB

View File

Before

Width:  |  Height:  |  Size: 459 KiB

After

Width:  |  Height:  |  Size: 459 KiB

View File

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 456 KiB

View File

Before

Width:  |  Height:  |  Size: 378 KiB

After

Width:  |  Height:  |  Size: 378 KiB

View File

Before

Width:  |  Height:  |  Size: 427 KiB

After

Width:  |  Height:  |  Size: 427 KiB

View File

Before

Width:  |  Height:  |  Size: 411 KiB

After

Width:  |  Height:  |  Size: 411 KiB

View File

Before

Width:  |  Height:  |  Size: 392 KiB

After

Width:  |  Height:  |  Size: 392 KiB

View File

Before

Width:  |  Height:  |  Size: 452 KiB

After

Width:  |  Height:  |  Size: 452 KiB

View File

Before

Width:  |  Height:  |  Size: 455 KiB

After

Width:  |  Height:  |  Size: 455 KiB

View File

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 295 KiB

View File

Before

Width:  |  Height:  |  Size: 376 KiB

After

Width:  |  Height:  |  Size: 376 KiB

View File

Before

Width:  |  Height:  |  Size: 328 KiB

After

Width:  |  Height:  |  Size: 328 KiB

View File

Before

Width:  |  Height:  |  Size: 365 KiB

After

Width:  |  Height:  |  Size: 365 KiB

View File

Before

Width:  |  Height:  |  Size: 335 KiB

After

Width:  |  Height:  |  Size: 335 KiB

View File

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 302 KiB

View File

Before

Width:  |  Height:  |  Size: 504 KiB

After

Width:  |  Height:  |  Size: 504 KiB

View File

Before

Width:  |  Height:  |  Size: 441 KiB

After

Width:  |  Height:  |  Size: 441 KiB

View File

Before

Width:  |  Height:  |  Size: 438 KiB

After

Width:  |  Height:  |  Size: 438 KiB

View File

Before

Width:  |  Height:  |  Size: 512 KiB

After

Width:  |  Height:  |  Size: 512 KiB

View File

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

Before

Width:  |  Height:  |  Size: 498 KiB

After

Width:  |  Height:  |  Size: 498 KiB

View File

Before

Width:  |  Height:  |  Size: 494 KiB

After

Width:  |  Height:  |  Size: 494 KiB

View File

Before

Width:  |  Height:  |  Size: 542 KiB

After

Width:  |  Height:  |  Size: 542 KiB

View File

Before

Width:  |  Height:  |  Size: 459 KiB

After

Width:  |  Height:  |  Size: 459 KiB

View File

Before

Width:  |  Height:  |  Size: 638 KiB

After

Width:  |  Height:  |  Size: 638 KiB

View File

@@ -0,0 +1,120 @@
#!/usr/bin/env python3
"""
Organize demo assets - rename and subfolder
Removes timestamps and organizes into proper structure
"""
import re
from pathlib import Path
import shutil
def rename_and_organize_demo():
"""Organize demo assets into subfolders with clean names"""
demo_base = Path("assets/images/demo")
categories = {
'characters': demo_base / 'characters',
'buildings': demo_base / 'buildings',
'terrain': demo_base / 'terrain',
'environment': demo_base / 'environment'
}
stats = {'renamed': 0, 'organized': 0}
for category_name, category_path in categories.items():
if not category_path.exists():
continue
print(f"\n📂 {category_name}/")
# Process all PNG files
for png_file in sorted(category_path.glob('*.png')):
# Skip if already in subfolder
if png_file.parent != category_path:
continue
filename = png_file.name
# Remove timestamp (13 digits at end before .png)
clean_name = re.sub(r'_\d{13}\.png$', '.png', filename)
if clean_name != filename:
stats['renamed'] += 1
print(f" ✏️ {filename}{clean_name}")
# Rename file
new_path = png_file.parent / clean_name
if new_path.exists():
# If target exists, keep the newer one
print(f" ⚠️ Target exists, keeping newer")
if png_file.stat().st_mtime > new_path.stat().st_mtime:
new_path.unlink()
png_file.rename(new_path)
else:
png_file.unlink()
else:
png_file.rename(new_path)
print(f"\n✅ Cleaned {stats['renamed']} filenames")
# NOW organize into subfolders
print("\n" + "="*70)
print("📁 ORGANIZING INTO SUBFOLDERS")
print("="*70)
for category_name, category_path in categories.items():
print(f"\n📂 {category_name}/")
# Get all PNG files again (with clean names now)
files = sorted(category_path.glob('*.png'))
if not files:
print(" ✓ No files to organize")
continue
# Group by base name
groups = {}
for f in files:
# Extract base name (before _styleA or _styleB)
match = re.match(r'(.+?)_(styleA|styleB)\.png$', f.name)
if match:
base_name = match.group(1)
if base_name not in groups:
groups[base_name] = []
groups[base_name].append(f)
# Create subfolders and move files
for base_name, file_list in sorted(groups.items()):
if len(file_list) < 2:
continue # Skip if not dual-style
subfolder = category_path / base_name
subfolder.mkdir(exist_ok=True)
print(f"\n 📁 {base_name}/ ({len(file_list)} files)")
for file_path in file_list:
# New organized name
if 'styleA' in file_path.name:
new_name = f"{base_name}_styleA_1024x1024.png"
else:
new_name = f"{base_name}_styleB_1024x1024.png"
target = subfolder / new_name
if not target.exists():
file_path.rename(target)
print(f"{new_name}")
stats['organized'] += 1
else:
print(f" ⏭️ Already exists: {new_name}")
print("\n" + "="*70)
print(f"✅ COMPLETE!")
print(f" Renamed: {stats['renamed']}")
print(f" Organized: {stats['organized']}")
print("="*70)
if __name__ == "__main__":
rename_and_organize_demo()