我想要为电子墨水显示器供电,为此,我需要 2 位图像。我目前正在使用 Pillow 创建图像并保存它,但黑白/灰度图像的选项只有 1 位和 8 位:
from PIL import Image
im1 = Image.new('1', (600, 800), color=1)
# creates 1-bit image, background color options range from 0 to 1, black and white
im2 = Image.new('1', (600, 800), color=123)
# creates 8-bit image, background color options range from 0 to 255, grayscale
我可以创建/保存 2 位图像吗?或者,之后有什么方法可以转换它们吗?
繁花如伊
相关分类