Files
Tagger/src/ui/utils.py

20 lines
417 B
Python
Raw Normal View History

2025-12-30 07:54:30 +01:00
"""
UI utility functions for Tagger GUI.
"""
from PIL import Image, ImageTk
def load_icon(path) -> ImageTk.PhotoImage:
"""
Load an icon from file and resize to 16x16.
Args:
path: Path to the image file
Returns:
ImageTk.PhotoImage resized to 16x16 pixels
"""
img = Image.open(path)
img = img.resize((16, 16), Image.Resampling.LANCZOS)
return ImageTk.PhotoImage(img)