mirror of
https://github.com/karl0ss/comfy_fm24_newgens.git
synced 2025-04-29 04:13:40 +01:00
reworked to work with processed_players
This commit is contained in:
parent
eb12cdcb15
commit
907a30f72f
@ -3,15 +3,14 @@ from PIL import Image
|
|||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
|
||||||
def resize_images(folder_path):
|
def resize_images(folder_path, processed_players):
|
||||||
# Loop through all files in the folder
|
# Loop through all files in the folder
|
||||||
for filename in tqdm(os.listdir(folder_path), desc="Resizing Images"):
|
for player in tqdm(processed_players, desc="Resizing Images"):
|
||||||
# Check if the file is a PNG image
|
player = f"{player}.png"
|
||||||
if filename.endswith('.png'):
|
# Full path to the image file
|
||||||
# Full path to the image file
|
image_path = os.path.join(folder_path, player)
|
||||||
image_path = os.path.join(folder_path, filename)
|
# Open the image file
|
||||||
# Open the image file
|
with Image.open(image_path) as img:
|
||||||
with Image.open(image_path) as img:
|
# Resize the image to 256x256
|
||||||
# Resize the image to 256x256
|
img_resized = img.resize((256, 256))
|
||||||
img_resized = img.resize((256, 256))
|
img_resized.save(os.path.join(folder_path, player))
|
||||||
img_resized.save(os.path.join(folder_path, filename))
|
|
Loading…
x
Reference in New Issue
Block a user