0
$\begingroup$

I am pretty confused about the concept of "image channels".

I want material that explains the concept of channels from scratch to whatever is required to understand their role in machine learning. I think that it is a small concept and possibly present as a chapter in good textbooks.

Where can I read about channels of an image in detail?

$\endgroup$
1
$\begingroup$

Image channels have nothing to do with machine learning, they are just part of computer image processing.

A channel is a number per pixel. So most colour images are stored with red, green and blue channels, as you probably know. Some images are stored in greyscale with just one white channel.

A RGB image is stored like this: pixel 0 red amount, pixel 0 green amount, pixel 0 blue amount, pixel 1 red amount, pixel 1 green amount, pixel 1 blue amount, pixel 2 red amount, ...

They could also be rearranged like this: pixel 0 red amount, pixel 1 red amount, pixel 2 red amount, ....., pixel 99999 red amount, pixel 0 green amount, pixel 1 green amount, ....., pixel 99999 green amount, pixel 0 blue amount, ....., pixel 99999 blue amount.
But that is not common.

A greyscale image only has one channel and it's stored like this: pixel 0 white amount, pixel 1 white amount, pixel 2 white amount, pixel 3 white amount, ...

A black-and-white image also has only one channel (a white channel) but that channel can only be 0 brightness or maximum brightness. They can be stored with just 1 bit per pixel.

Alpha is an extra transparency channel that some pictures have. Alpha 0 means fully transparent. Maximum alpha means fully opaque. Half-maximum alpha means the image is partially see-through at that pixel. Things like photos don't have alpha, but computer graphics that are designed to be displayed on top of other pictures often do.

There are also more exotic systems like YCbCr, where you have a white channel, a blue-versus-green channel, and a red-versus-green channel. Mostly we just convert those to RGB before processing.

$\endgroup$
3
  • $\begingroup$ "A channel is a number per pixel", I don't think this description is correct: a channel is not a number. A channel often contains the values associated with one specific color, while another channel contains the values associated with another color. $\endgroup$
    – nbro
    Jul 31 '21 at 17:19
  • $\begingroup$ @nbro yes, the concept of "red" is a function from pixel coordinates to numbers. You can ask how much redness is at a given pixel coordinate. You can also ask how much greenness, which is a different function. $\endgroup$
    – user253751
    Jul 31 '21 at 21:03
  • $\begingroup$ Still, how is a channel a number per pixel? Maybe there are some typos in your answer. $\endgroup$
    – nbro
    Aug 1 '21 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.