Skip to content

Commit bfcfa61

Browse files
author
marci
committed
fix: replace blurry upscaled PNG icons with high-quality SVG-generated icons
- Generate crisp PNG icons directly from SVG using cairosvg - Add support for 256px icon size for better high-DPI display support - Create generate_icons.py script for easy icon regeneration - Significantly reduce file sizes while improving visual quality - Update icon loading to support all sizes (16px to 256px)
1 parent 3d4096a commit bfcfa61

9 files changed

Lines changed: 76 additions & 2 deletions

assets/bash-script-maker-128.png

185 Bytes
Loading

assets/bash-script-maker-16.png

-1.03 KB
Loading

assets/bash-script-maker-256.png

29.3 KB
Loading

assets/bash-script-maker-32.png

184 Bytes
Loading

assets/bash-script-maker-48.png

234 Bytes
Loading

assets/bash-script-maker-64.png

68 Bytes
Loading

bash_script_maker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def set_window_icon(self):
267267
script_dir = os.path.dirname(os.path.abspath(__file__))
268268

269269
# Icon-Größen die wir haben
270-
icon_sizes = [16, 32, 48, 64, 128]
270+
icon_sizes = [16, 32, 48, 64, 128, 256]
271271
icon_files = []
272272

273273
# Verfügbare Icon-Dateien sammeln

generate_icons.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Icon-Generator für Bash-Script-Maker
5+
Erstellt PNG-Icons in verschiedenen Größen aus der SVG-Datei
6+
"""
7+
8+
import os
9+
import sys
10+
11+
def generate_icons():
12+
"""Generiert PNG-Icons aus der SVG-Datei"""
13+
try:
14+
import cairosvg
15+
except ImportError:
16+
print("Fehler: cairosvg ist nicht installiert.")
17+
print("Installieren Sie es mit: pip install cairosvg")
18+
return False
19+
20+
# Pfade definieren
21+
script_dir = os.path.dirname(os.path.abspath(__file__))
22+
svg_path = os.path.join(script_dir, "assets", "bash-script-maker.svg")
23+
24+
if not os.path.exists(svg_path):
25+
print(f"Fehler: SVG-Datei nicht gefunden: {svg_path}")
26+
return False
27+
28+
# Icon-Größen definieren
29+
sizes = [16, 32, 48, 64, 128, 256]
30+
31+
print("=== Bash-Script-Maker Icon Generator ===")
32+
print(f"Quelle: {svg_path}")
33+
print()
34+
35+
success_count = 0
36+
37+
for size in sizes:
38+
output_path = os.path.join(script_dir, "assets", f"bash-script-maker-{size}.png")
39+
40+
try:
41+
# SVG zu PNG konvertieren
42+
cairosvg.svg2png(
43+
url=svg_path,
44+
write_to=output_path,
45+
output_width=size,
46+
output_height=size
47+
)
48+
49+
# Dateigröße überprüfen
50+
file_size = os.path.getsize(output_path)
51+
print(f"✓ {os.path.basename(output_path)} ({size}x{size}) - {file_size:,} Bytes")
52+
success_count += 1
53+
54+
except Exception as e:
55+
print(f"✗ Fehler bei {size}x{size}: {e}")
56+
57+
print()
58+
print(f"Erfolgreich: {success_count}/{len(sizes)} Icons erstellt")
59+
return success_count == len(sizes)
60+
61+
def main():
62+
"""Hauptfunktion"""
63+
if len(sys.argv) > 1 and sys.argv[1] in ['-h', '--help']:
64+
print(__doc__)
65+
print("\nVerwendung:")
66+
print(" python3 generate_icons.py")
67+
print("\nVoraussetzungen:")
68+
print(" pip install cairosvg")
69+
return
70+
71+
success = generate_icons()
72+
sys.exit(0 if success else 1)
73+
74+
if __name__ == "__main__":
75+
main()

test_release.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)