python get pixel 1

python get pixel

im = Image.open('image.gif')
rgb_im = im.convert('RGB')
r, g, b = rgb_im.getpixel((1, 1))

print(r, g, b)
(65, 100, 137)

Here is what the above code is Doing:
1. Open the image.gif file and convert it to RGB.
2. Get the RGB value of the pixel at (1, 1).
3. Print the RGB values.

Similar Posts