from PIL import Image
import os


def resize(folder_path):
    for filename in os.listdir(folder_path):
        if filename.endswith('.png'):
            file_path = os.path.join(folder_path, filename)
            with Image.open(file_path) as img:
                if img.size == (16, 16):  # Target 16x16 Images
                    img_resized = img.resize((128, 128), Image.NEAREST)
                    img_resized.save(file_path)
                    print(f'Resized and saved {filename}')


folder_path = 'block'

resize(folder_path)
