from PIL import Image img = Image.open("qqqqq.png")print (img.size) #这里运行打印出图片尺寸(10,24)print(img.getpixel((10,24))) #这里运行出错提示: # IndexError: image index out of range
from PIL import Imageimg = Image.open("qqqqq.png")print(img.getpixel((4,4))) #这里运行打印结果:3
img = Image.open("qqqqq.png")img.putpixel((4,4),(255,255,0)) #这行运行提示错误: #TypeError: function takes exactly 1 argument (3 given) img.save("qqqqq-2.png","png")
茅侃侃