When I run this code, I get a single value for the pixel,now I don't know what the single value represents..red, green, blue, or some average of them all.
I was wondering how I can get all the values of RGB separate, like in a tuple or some other source so I can change each one separately.
from PIL import Image
img = Image.open("flower.jpg")
img = img.convert("L")
pix = img.load()
img.save('test2.jpg')
h = img.size[0]
w = img.size[1]
for x in range(h):
for y in range(w):
xy = (x, y)
pix = img.getpixel(xy)
print(pix[x,y])