Ayudh
Ayudh

Reputation: 1763

Python PIL load() giving pixel map with data as tuple with 4 values

here's my code:

from PIL import Image

im = Image.open(name)
pixelMap = im.load()
print(pixelMap[0,0])

this outputs (238, 238, 238, 255)

I suppose the first 4 values are the RGB values but what is the last 255 value??

Upvotes: 0

Views: 1007

Answers (1)

amlarraz
amlarraz

Reputation: 70

The last value (255) is the value in the alpha-channel. If you open your image with GIMP you can see the alpha full white channel.

Upvotes: 2

Related Questions