doom
This commit is contained in:
41
fix_ui_images.py
Normal file
41
fix_ui_images.py
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
import os
|
||||
from PIL import Image
|
||||
|
||||
# Source map (using the v2 originals found in temp)
|
||||
source_map = {
|
||||
"okvir_zarjavel.png": "/Users/davidkotnik/.gemini/antigravity/brain/998d0b10-1733-4e5b-85ed-249b986ba9b3/okvir_zarjavel_v2_1768954465913.png",
|
||||
"merilec_zdravja.png": "/Users/davidkotnik/.gemini/antigravity/brain/998d0b10-1733-4e5b-85ed-249b986ba9b3/merilec_zdravja_v2_1768954479566.png",
|
||||
"gumb_recikliran.png": "/Users/davidkotnik/.gemini/antigravity/brain/998d0b10-1733-4e5b-85ed-249b986ba9b3/gumb_recikliran_v2_1768954494464.png",
|
||||
"amnezija_maska.png": "/Users/davidkotnik/.gemini/antigravity/brain/998d0b10-1733-4e5b-85ed-249b986ba9b3/amnezija_maska_v2_1768954510228.png"
|
||||
}
|
||||
|
||||
# Target dimensions
|
||||
dimensions = {
|
||||
"okvir_zarjavel.png": (800, 250),
|
||||
"merilec_zdravja.png": (256, 256),
|
||||
"gumb_recikliran.png": (300, 100),
|
||||
"amnezija_maska.png": (1920, 1080)
|
||||
}
|
||||
|
||||
output_dir = "/Users/davidkotnik/repos/novafarma/assets/slike/NOVE_SLIKE/UI/UI/"
|
||||
|
||||
for filename, source_path in source_map.items():
|
||||
if os.path.exists(source_path):
|
||||
try:
|
||||
with Image.open(source_path) as img:
|
||||
# Ensure it's RGBA
|
||||
img = img.convert("RGBA")
|
||||
|
||||
# Resize
|
||||
target_size = dimensions[filename]
|
||||
resized_img = img.resize(target_size, Image.Resampling.LANCZOS)
|
||||
|
||||
# Save as proper PNG
|
||||
dest_path = os.path.join(output_dir, filename)
|
||||
resized_img.save(dest_path, "PNG")
|
||||
print(f"Fixed and saved: {dest_path}")
|
||||
except Exception as e:
|
||||
print(f"Error processing {filename}: {e}")
|
||||
else:
|
||||
print(f"Source not found for {filename}: {source_path}")
|
||||
Reference in New Issue
Block a user