from PIL import Image, ImageFilter before = Image.open("IMAGE_NAME.file_type") after = before.filter(ImageFilter.FIND_EDGES) after.save("IMAGE_NAME.file_type")