【发布时间】:2020-09-10 18:45:38
【问题描述】:
我想为 E-Ink 显示器供电,为此,我需要 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 位图像吗?或者,以后有什么方法可以转换它们吗?
我知道这个帖子:converting images to indexed 2-bit grayscale BMP。 我想知道是否有更有效的方法。
【问题讨论】:
-
@Alderven 是的,有点!谢谢!我只是想知道,是否有更有效的方法。
标签: python image-processing python-imaging-library