Python PIL创建8bit以及16bit灰度图

from PIL import Image

width = 320

height = 240


img_gray_8 = Image.new('L', (width, height), 128)

img_gray_16 = Image.new('I;16', (width, height), 128)

img_gray_8.save("img_gray_8.bmp")

img_gray_16.save("img_gray_16.png")

你可能感兴趣的:(Python PIL创建8bit以及16bit灰度图)