欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python使用PIL模塊獲取圖片像素點(diǎn)的方法

 更新時(shí)間:2019年01月08日 09:01:39   作者:ABigCaiBird  
今天小編就為大家分享一篇python使用PIL模塊獲取圖片像素點(diǎn)的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧

如下所示:

from PIL import Image
########獲取圖片指定像素點(diǎn)的像素
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())

以上這篇python使用PIL模塊獲取圖片像素點(diǎn)的方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論