I'm trying to loop through each pixel of an image, process that pixel, and set the pixel to a new color.
I've tried using Pillow:
from PIL import Image
picture = Image.open("image.png")
# Get the size of the image
width, height = picture.size
# Process every pixel
for x in range(0, width):
for y in range(0, height):
current_color = picture.getpixel( (x,y) )
print(current_color)
new_color = processPixel(current_color)
picture.putpixel( (x,y), new_color)
But printing current_color
just prints 0
for each pixel in the image
Here is the picture I'm using