As you see in my code I use Pillow to work with the image. My goal is to jump down one "y coordinate" if the value of the "x coordinate" is 1280(because that's the resolution on the image).
When running this code, it stops when printing all the colors of the pixels in the first row. It doesn't continue with the next row.
from PIL import Image
x = 0
y = 0
def pixel_analyze():
image = Image.open(r"\Users\madst\Pictures\image.png")
image_rgb = image.convert("RGB")
pixel_color = image_rgb.getpixel((x, y))
print(pixel_color)
while x <=1280:
if('x<=1280'):
x +=1
pixel_analyze()
else:
y += 1
x = 0
pixel_analyze()
Aucun commentaire:
Enregistrer un commentaire