代码如下: 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.save(image_path) # 1 通道转3通道 elif image.
代码如下:
|
2019-06-18
2019-07-04
2021-05-23
2021-05-27
2021-05-27