import os
from PIL import Image
directory = r'C:\Users\user\Desktop\*каталог, в котором находятся изображения*'
images = os.listdir(directory)
for image_name in images:
image_path = os.path.join(directory, image_name)
img = Image.open(image_path)
img_size = (200, 200)
img.thumbnail(img_size)
new_image_name = '_s.'.join(image_name.rsplit('.', 1))
new_image_path = os.path.join(directory, new_image_name)
img.save(new_image_path)