0

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?

hanugm
  • 3,571
  • 3
  • 18
  • 50

1 Answers1

1

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.

user253751
  • 922
  • 3
  • 11
  • "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. – nbro Jul 31 '21 at 17:19
  • @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. – user253751 Jul 31 '21 at 21:03
  • Still, how is a channel a **number per pixel**? Maybe there are some typos in your answer. – nbro Aug 01 '21 at 11:13