时间:2021-03-28 09:15:27 | 栏目:Python代码 | 点击:次
如下所示:
from PIL import Image
########获取图片指定像素点的像素
def getPngPix(pngPath = "aa.png",pixelX = 1,pixelY = 1):
img_src = Image.open(pngPath)
img_src = img_src.convert('RGBA')
str_strlist = img_src.load()
data = str_strlist[pixelX,pixelY]
img_src.close()
return data
print(getPngPix())