Get RGB value of each pixel from an Image in Python (The easiest way)

I used this library: PILLOW


To install the library, just type >>> pip install PILLOW <<<  in the terminal.

Use this code to print each pixel's RGB value in console:

from PIL import Image
with Image.open("testBitmap.jpg") as im:
px = im.load()

for i in range(612):
for j in range(612):
print(px[i,j])

Comments

Popular posts from this blog

Husband's Affair with Step Daughter Ends in Grisly Murder (True Crime Documentary)