2024-12-13 12:06:05 +00:00
|
|
|
import os
|
|
|
|
from PIL import Image
|
|
|
|
from tqdm import tqdm
|
|
|
|
|
|
|
|
|
2024-12-16 15:56:29 +00:00
|
|
|
def resize_images(folder_path, processed_players):
|
2024-12-13 12:06:05 +00:00
|
|
|
# Loop through all files in the folder
|
2024-12-16 15:56:29 +00:00
|
|
|
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))
|