how to composite images in pil with x and y axis code example
Example 1: pillow image from array
PIL.Image.fromarray(your_array)
Example 2: convert rgb image to binary in pillow
from PIL import Image
col = Image.open("cat-tied-icon.png")
gray = col.convert('1')
bw.save("result_bw.png")