我就废话不暂不多说了,间接上代码吧! from PIL import Image # 通道转换 def change_image_channels(image, image_path): # 4通道转3通道 if image.mode == 'RGBA': r, g, b, a = image.split() image = Image.merge("RGB", (r, g, b)) image.saZZZe(image_path) # 1 通道转3通道 elif image.mode != 'RGB': i