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")
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灰度图
本文链接:https://www.haomeiwen.com/subject/sztnzhtx.html
网友评论