logo

t是rgb转成的灰度图,为啥get_pixel会返回None类型,同时我通过set_pixel修改以后还是有None

2020-09-24 21:19
M
gayn
请在这里粘贴代码       
 for i in range (0,t.height()):
            for j in range (0,t.width()):
                pix=t.get_pixel(i,j)
                if pix is None:
                    t.set_pixel(i,j,0)
                else:
                    if t.get_pixel(i,j)<15:
                        t.set_pixel(i,j,255)
                    else:
                        t.set_pixel(i,j,0)
        lcd.display(t)
        
        for i in range (0,t.height()):
            for j in range (0,t.width()):
                pix=t.get_pixel(i,j)
                print(pix,end=',')
            print()
        print('the end')![0_1600953543903_QV$Y~A%UGHT~MJS9WI2VXQE.png](https://fcdn.singtown.com/c1e4a61e-0898-4bd6-8190-a03f5747e501.png)
M
gayn
d4eeee73-1920-4b49-93b6-08c1bcd55e97.png
2020-09-28 21:48
I
网红小智智 星瞳科技

需要全部代码,否则没办法测试。