HOME/Articles/

pil example PIL org Split (snippet)

Article Outline

Python pil example 'PIL org Split'

python PIL org Split

Python pil example: PIL org Split

#通道分离
from __future__ import print_function
from PIL import Image


imin = "testbig.jpg"
im = Image.open(imin)


r, g, b = im.split()#通道分离
r.show()
g.show()
b.show()

im = Image.merge("RGB", (b, g, r))#b,r通道翻转后合并
im.show()