1. 程式人生 > >PIL Image 學習記錄

PIL Image 學習記錄

pos port print format from 學習記錄 mat .sh class

from PIL import Image
im01 = Image.open("./timg.jpg")
im02 = Image.open("./1234.jpg")
print(im01.format)
print(im01.mode)
print(im01.size)
print(im02.size)
out=im01.resize((1001,1191),Image.ANTIALIAS).save("./1234_1.jpg")
im04 = Image.open("./1234_1.jpg")
print(im02.size)
print(im01.palette)
print(im01.info)
im = Image.new("RGB",(128,128))
# im.show()
im03 = Image.blend(im04,im02,0.7)
im03.save("./12.jpg")
box = [0, 0, 100, 100]
im_crop = im01.crop(box)

PIL Image 學習記錄