from PIL import Image, ImageDraw import os # Create a 64x64 image with transparent background size = 64 img = Image.new('RGBA', (size, size), (255, 255, 255, 0)) draw = ImageDraw.Draw(img) # Draw a simple train # Body (rectangle) draw.rectangle([10, 20, 50, 40], fill=(59, 130, 246, 255)) # blue # Cabin (small rectangle) draw.rectangle([50, 25, 58, 35], fill=(30, 64, 175, 255)) # Chimney draw.rectangle([20, 10, 25, 20], fill=(239, 68, 68, 255)) # Wheels wheel_color = (17, 24, 39, 255) draw.ellipse([15, 45, 25, 55], fill=wheel_color) draw.ellipse([35, 45, 45, 55], fill=wheel_color) draw.ellipse([50, 45, 58, 53], fill=wheel_color) # Save as PNG output_path = 'LightRAG-main/lightrag/api/webui/favicon.png' img.save(output_path, 'PNG') print(f'Generated favicon at {output_path}') # Also generate a 32x32 version for better favicon scaling img32 = img.resize((32, 32), Image.Resampling.LANCZOS) img32.save(output_path.replace('.png', '_32.png'), 'PNG') print('Generated 32x32 version')