请尝试以下文档中的内容:http ://effbot.org/imagingbook/imageops.htm
from PIL import Image
import PIL.ImageOps
image = Image.open('your_image.png')
inverted_image = PIL.ImageOps.invert(image)
inverted_image.save('new_name.png')
注意:“ ImageOps模块包含许多“现成的”图像处理操作。该模块有些实验性,大多数操作员只能处理L和RGB图像。