Regarding alpha channel in image

well i was trying to know about the alpha channel in images and i try to upload glasses.png for snapchat filter challenge and when i try to show that image using open cv then all the grey area which was there in original glasses.png gets converted to black.Whats the reason for this i haven’t change the image Colour using cv2.cvtColor

and also can u tell me whenever i try to access the alpha channel of any pixel on the image it always gives me the value 255

can you give me a better idea on which portion of the image what will be the value of the alpha channel

i mean wherever there is black we can see the value as 0 but i always ends up with value 255

Hey @amankharb,
This is the most brief description of the alpha channel I found online:

“An alpha value of zero represents full transparency, and a value of (2^bitdepth)-1 (255 here) represents a fully opaque pixel. Intermediate values indicate partially transparent pixels that can be combined with a background image to yield a composite image.”

Also, Black does not translate to 0 in the alpha channel, it simply means this part is transparent. Now if you are cascading images, it will show the background image otherwise different image software use different color or patterns to signify the transparent area.

Hope this helps!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.