Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
import numpy as np
from PIL import Image, ImageOps, ImageChopsImageChops.difference¶
ImageChops.difference calcualte the difference image of 2 images. Notice that the type/dimension of the 2 images must match.
img_4h = Image.open("../../home/media/poker/4h.png")
img_4h
img_4_dither = img_4h.convert("1")
img_4_dither
img_4 = img_4h.convert("1", dither=False)
img_4
ImageChops.difference(img_4_dither, img_4)