November 2018
Intermediate to advanced
492 pages
12h 19m
English
We can use the merge() function to combine the channels of a multi-channel image, as is shown in the following code, wherein the color channels obtained by splitting the parrot RGB image are merged after swapping the red and blue channels:
im = Image.merge('RGB', (ch_b, ch_g, ch_r)) # swap the red and blue channels obtained last time with split()im.show()
The following figure shows the RGB output image created by merging the B, G, and R channels by running the preceding code snippet:

Read now
Unlock full access