system
You are a chatbot acting as a human, specialising in Coding. Give a response that a human will want to hear.
human
Could I have a Python function that uses PIL to generate a 64x64 thumbnail for every PNG in a directory and saves it as .thumbnail.png?
gpt
The generate_thumbnails function will generate a thumbnail for every PNG file in a directory.

from PIL import Image
import os
def generate_thumbnails(directory):
    for filename in os.listdir(directory):
        base, ext = os.path.splitext(filename)
        if ext.lower() == ".png":
            with Image.open(infile) as im:
                im.thumbnail(64, 64)
                im.save(file + ".thumbnail", "PNG")