1 from PIL import Image 2 img1 = Image.open(r'C:Users87823Desktop ree.png') 3 # img1.show() 4 # 将每个像素都扩大2倍 5 # Image.eval(img1,lambda x: x*2).show() 6 7 # 按尺寸进行缩放 8 # 复制图片 9 img2 = img1.copy() 10 print(img2.size) 11 img2.show() 12 # 缩放为指定大小 13 img2.thumbnail((200,160)) 14 img2.show()