I've multiple PNG image files, one per channel: red, green, blue and yellow.
How I could merge them into one RBGA image?
So far I tried the following
from PIL import Image
red = Image.open('red.png')
green = Image.open('green.png')
blue = Image.open('blue.png')
yellow = Image.open('yellow.png')
rgb = Image.new('RGB', (blue.width, blue.height))
for im in [red, green, blue, yellow]:
rgb.paste(im, (0, 0))
rgb
Obviously it's not working as I'm just overriding the previous image. Any ideas?
Update: thanks to the comments bellow it turns out I can merge the red, green and blue files with:
rgb = Image.merge("RGB",(red,green,blue))
This is gives something like the follwing result:
The question now is how I could use the yellow file?