ImageFilter.BLUR, SHARPEN, FIND_EDGES are convolution shortcuts.
Goal
Blur a two-color split and print the mode.
from PIL import Image, ImageFilter
import numpy as np
arr = np.zeros((40, 80, 3), dtype=np.uint8)
arr[:, :40] = (200, 40, 40)
arr[:, 40:] = (40, 40, 200)
im = Image.fromarray(arr).filter(ImageFilter.BLUR)
plt.imshow(im)
plt.axis('off')
plt.show()
print(im.mode)from PIL import Image, ImageFilter
im = Image.new('RGB', (20, 20), (200, 40, 40))
print(im.filter(ImageFilter.SHARPEN).size)from PIL import Image, ImageFilter
print(Image.new('L', (16, 16), 0).filter(ImageFilter.FIND_EDGES).mode)from PIL import Image, ImageFilter
print(ImageFilter.BLUR)