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

Apple iPad Air (2022) Specifications and Review in 2023

17-year-old suspect in fatal stabbing at Taylor Swift-themed dance event ID’d

Learning Python - 7th Day (Night - 2)