from PIL import Image

# Open the image
image = Image.open('alles_mit_flag.bmp')

# Split the image into Red, Green, and Blue channels
red, green, blue = image.split()

# Save each channel as a separate grayscale image
red.save('red_channel.bmp')
green.save('green_channel.bmp')
blue.save('blue_channel.bmp')

# Optionally, show the images
red.show()
green.show()
blue.show()
