Image encoding

Grayscale images

Can be represented as a 2D matrix of shape height × width, with each element is a 8-bit integer representing the intensity of light [0,255], from zero to maximum intensity (black to white)

RGB images

Each pixel has three values representing the intensity of light for each Colour channel

Hence, can be represented as a 3D tensor of shape height × width × 3, with each element being a 8-bit integer representing the intensity of the colour channel