mirror of
https://github.com/karl0ss/comfy_fm24_newgens.git
synced 2025-04-28 20:03:40 +01:00
16 lines
571 B
Python
16 lines
571 B
Python
import os
|
|
from PIL import Image
|
|
from tqdm import tqdm
|
|
|
|
|
|
def resize_images(folder_path, processed_players):
|
|
# Loop through all files in the folder
|
|
for player in tqdm(processed_players, desc="Resizing Images"):
|
|
player = f"{player}.png"
|
|
# Full path to the image file
|
|
image_path = os.path.join(folder_path, player)
|
|
# Open the image file
|
|
with Image.open(image_path) as img:
|
|
# Resize the image to 256x256
|
|
img_resized = img.resize((256, 256))
|
|
img_resized.save(os.path.join(folder_path, player)) |