split returns R, G, B bands. merge puts them back.
Goal
Zero the blue band and print a pixel.
from PIL import Image
im = Image.new('RGB', (16, 16), (10, 20, 30))
r, g, b = im.split()
print(r.mode, r.getpixel((0, 0)), g.getpixel((0, 0)), b.getpixel((0, 0)))from PIL import Image
im = Image.new('RGB', (16, 16), (10, 20, 30))
r, g, b = im.split()
merged = Image.merge('RGB', (r, g, Image.new('L', im.size, 0)))
print(merged.getpixel((0, 0)))
plt.imshow(merged)
plt.axis('off')
plt.show()from PIL import Image
print(len(Image.new('RGB', (2, 2)).split()))from PIL import Image
print(Image.merge('RGB', [Image.new('L', (4, 4), c) for c in (255, 0, 0)]).getpixel((0, 0)))