Python — change the RGB values of the image and save as a image
问题 I can read every pixel' RGB of the image already, but I don't know how to change the values of RGB to a half and save as a image.Thank you in advance. 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] 回答1: You can do everything you are wanting to do within PIL. If you are wanting to reduce the value of every