a
This commit is contained in:
17
WS24_25/PyCharm/pythonProject/A/a.py
Normal file
17
WS24_25/PyCharm/pythonProject/A/a.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user