fool

from PIL import Image

img = Image.open("D:\\pic2\\CZA3302.png")
(w,h) = img.size
im=img.convert("RGB")



for i in xrange(w):
for j in xrange(h):
pos=(i,j)
rgb = im.getpixel(pos)


if rgb == (186, 197, 217):
im.putpixel((i,j),(255,255,255))
if rgb == (180, 192, 213):
im.putpixel((i,j),(255,255,255))
if rgb == (168, 183, 207):
im.putpixel((i,j),(255,255,255))
if rgb == (230, 237, 241):
im.putpixel((i,j),(255,255,255))
if rgb == (155, 182, 201):
im.putpixel((i,j),(255,255,255))
if rgb == (216, 227, 235):
im.putpixel((i,j),(255,255,255))
if rgb == (247, 247, 247):
im.putpixel((i,j),(255,255,255))
if rgb == (239, 244, 247):
im.putpixel((i,j),(255,255,255))

if rgb == (238, 241, 245):
im.putpixel((i,j),(255,255,255))
if rgb == (248, 250, 252):
im.putpixel((i,j),(255,255,255))
if rgb == (192, 193, 223):
im.putpixel((i,j),(255,255,255))
if rgb == (174, 187, 210):
im.putpixel((i,j),(255,255,255))
if rgb == (209, 216, 229):
im.putpixel((i,j),(255,255,255))
if rgb == (190, 207, 221):
im.putpixel((i,j),(255,255,255))
if rgb == (156, 183, 203):
im.putpixel((i,j),(255,255,255))
if rgb == (212, 223, 232):
im.putpixel((i,j),(255,255,255))

if rgb == (197, 207, 223):
im.putpixel((i,j),(255,255,255))
if rgb == (222, 222, 239):
im.putpixel((i,j),(255,255,255))
if rgb == (222, 231, 238):
im.putpixel((i,j),(255,255,255))
if rgb == (196, 212, 223):
im.putpixel((i,j),(255,255,255))
if rgb == (233, 240, 246):
im.putpixel((i,j),(255,255,255))

im.save('D:\\Python27\\6.png')



转载于:https://www.cnblogs.com/cutepython/p/6126793.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值