Files
FH/WS24_25/PyCharm/pythonProject/A/a.py
2024-10-13 21:47:23 +02:00

18 lines
376 B
Python

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()