putpixel

时间:2023-03-09 15:09:06
putpixel
from PIL import Image

img = Image.open("D:\Python27\ggg.gif")
(w,h) = img.size
im=img.convert("RGBA") for i in xrange(w):
for j in xrange(h):
pos=(i,j)
rgb = im.getpixel(pos) if rgb == (255,255,255,255):
im.putpixel((i,j),(0,0,0,0)) im.save('D:\\Python27\\ggg888.gif') #(r,g,b) = rgb '''
if(b > g and b > r):
b=213
g=192
r=180
img.putpixel((i,j), (000,000,000)) '''
#im.show() #p.save('D:\\Python27\\mask6.gif')