#!/usr/bin/env python3
from PIL import Image
import os

directory = os.path.dirname(os.path.abspath(__file__))
extensions = ('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.webp')

for filename in os.listdir(directory):
    if filename.lower().endswith(extensions) and filename != 'resize_images.py':
        filepath = os.path.join(directory, filename)
        with Image.open(filepath) as img:
            resized = img.resize((64, 64), Image.LANCZOS)
            resized.save(filepath)
            print(f"Resized: {filename}")

print("Done!")
