1 2 3 4 5 6 7
from PIL import ImageOps def inversion(im): im = im.convert('RGB') inv = ImageOps.invert(im) return inv