SuiteConsultance/create_logo.py
2025-09-20 13:18:04 +02:00

81 lines
2.6 KiB
Python

# Logo Creation Script
from PIL import Image, ImageDraw, ImageFont
import os
def create_logo(filename, bg_color, text_color):
"""Create a logo for SuiteConsultance"""
# Create a blank image with a white background
width, height = 400, 400
image = Image.new('RGBA', (width, height), bg_color)
# Create a drawing context
draw = ImageDraw.Draw(image)
# Draw a circle background
circle_center = (width // 2, height // 2)
circle_radius = 150
draw.ellipse(
(
circle_center[0] - circle_radius,
circle_center[1] - circle_radius,
circle_center[0] + circle_radius,
circle_center[1] + circle_radius
),
fill=bg_color, outline=text_color, width=8
)
# Try to load a font, fall back to default if not available
try:
font_large = ImageFont.truetype("Arial.ttf", 120)
font_small = ImageFont.truetype("Arial.ttf", 30)
except IOError:
font_large = ImageFont.load_default()
font_small = ImageFont.load_default()
# Draw the "SC" text
text = "SC"
text_bbox = draw.textbbox((0, 0), text, font=font_large)
text_width = text_bbox[2] - text_bbox[0]
text_height = text_bbox[3] - text_bbox[1]
text_position = (
(width - text_width) // 2,
(height - text_height) // 2 - 20
)
draw.text(text_position, text, font=font_large, fill=text_color)
# Draw "Suite Consultance" text below
subtext = "Suite Consultance"
subtext_bbox = draw.textbbox((0, 0), subtext, font=font_small)
subtext_width = subtext_bbox[2] - subtext_bbox[0]
subtext_height = subtext_bbox[3] - subtext_bbox[1]
subtext_position = (
(width - subtext_width) // 2,
(height + text_height) // 2 + 30
)
draw.text(subtext_position, subtext, font=font_small, fill=text_color)
# Save the image
image.save(filename)
print(f"Logo saved to {filename}")
if __name__ == "__main__":
# Create Data directory if it doesn't exist
data_dir = "Data"
if not os.path.exists(data_dir):
os.makedirs(data_dir)
# Create light mode logo (dark text on light background)
create_logo(
os.path.join(data_dir, "logo_light.png"),
bg_color=(255, 255, 255, 255), # White
text_color=(41, 128, 185, 255) # Blue
)
# Create dark mode logo (light text on dark background)
create_logo(
os.path.join(data_dir, "logo_dark.png"),
bg_color=(52, 73, 94, 255), # Dark Blue
text_color=(236, 240, 241, 255) # White/Light Grey
)
print("Logo generation complete!")