Programming Assignment 1 Week 1 Standardization

To represent color images, the red, green and blue channels (RGB) must be specified for each pixel, and so the pixel value is actually a vector of three numbers ranging from 0 to 255.

What does this mean exactly - 3 numbers ranging from 0 to 255 ?

It means every pixel has a value between 0 and 255 when a tensor representation is taken of the image. And you also have 3 channels i.e. 1 pixel per channel.

1 Like

Right. The reason behind this is that the RGB color values of pixels are stored as unsigned 8 bit integers to save space. If you stored each value as a 32 or 64 bit float, that would be hideously expensive in terms of storage. This is the way image formats have been defined for a very long time (since digital images were first created). That was quite a while ago and back then storage and memory were a lot smaller and more expensive than they are now. But cameras are also a lot higher resolution now, so the same tradeoff still applies. A 15 megapixel image is a pretty huge file even with 24 bits per pixel. :nerd_face:

You can find more information about how images are stored by just googling one of the popular image formats like JPEG, TIFF or PNG. E.g. here’s an article about JPEG format.