diff --git a/scripts/generate_icons.py b/scripts/generate_icons.py new file mode 100644 index 0000000..26305bb --- /dev/null +++ b/scripts/generate_icons.py @@ -0,0 +1,39 @@ +from PIL import Image, ImageDraw, ImageFont +import os + +def create_icon(size): + # Erstelle ein neues Bild mit grünem Hintergrund + image = Image.new('RGB', (size, size), '#4CAF50') + draw = ImageDraw.Draw(image) + + # Versuche, eine Schriftart zu laden + try: + font = ImageFont.truetype("arial.ttf", size // 3) + except: + font = ImageFont.load_default() + + # Text "MEDI" zeichnen + text = "MEDI" + text_bbox = draw.textbbox((0, 0), text, font=font) + text_width = text_bbox[2] - text_bbox[0] + text_height = text_bbox[3] - text_bbox[1] + x = (size - text_width) // 2 + y = (size - text_height) // 2 + draw.text((x, y), text, fill='white', font=font) + + # Speichere das Icon + output_file = f'static/images/icon-{size}x{size}.png' + image.save(output_file, 'PNG') + print(f'Icon {size}x{size} generiert: {output_file}') + +def main(): + # Erstelle das Verzeichnis, falls es nicht existiert + os.makedirs('static/images', exist_ok=True) + + # Generiere Icons in verschiedenen Größen + sizes = [192, 512] + for size in sizes: + create_icon(size) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/static/images/icon-192x192.png b/static/images/icon-192x192.png new file mode 100644 index 0000000..07e2c5f Binary files /dev/null and b/static/images/icon-192x192.png differ diff --git a/static/images/icon-512x512.png b/static/images/icon-512x512.png new file mode 100644 index 0000000..03d6581 Binary files /dev/null and b/static/images/icon-512x512.png differ diff --git a/static/images/icon.svg b/static/images/icon.svg new file mode 100644 index 0000000..af6b6cd --- /dev/null +++ b/static/images/icon.svg @@ -0,0 +1,25 @@ + + + + + + + + MEDI + + + + + \ No newline at end of file