#coding:utf-8
#
import os
from PIL import ImageGrab

from PIL import Image

path = "d:\\mobile\\pingmu.png"
im = ImageGrab.grab()

img = im.convert("RGBA")
pixdata = img.load()
#二值化
for y in xrange(img.size[1]):
    for x in xrange(img.size[0]):
        #print pixdata[x, y]
        #print pixdata[x, y][0]
        if(pixdata[x, y]==(223,75,80,255)):
            print x 
            print y
img.save(path)

 

posted on 2015-09-22 15:11  小白闯天下  阅读(153)  评论(0编辑  收藏  举报