我已经可以读取图像的每个像素的RGB,但是我不知道如何将RGB的值更改为一半并保存为图像。提前谢谢。
from PIL import *
def half_pixel(jpg):
im=Image.open(jpg)
img=im.load()
print(im.size)
[xs,ys]=im.size #width*height
# Examine every pixel in im
for x in range(0,xs):
for y in range(0,ys):
#get the RGB color of the pixel
[r,g,b]=img[x,y]
目前没有回答
相关问题 更多 >
编程相关推荐