This article summarizes the image storage format that I understand.
The data in the computer is binary, so the picture is no exception.
This is a description of the OpenCV document, which is stored in the code using a matrix.
Similar is (BGR format):
The smallest unit of the picture is the pixel, here is the BGR (usually the notation of blud, Green, and red) that represents each pixel corresponding to the value (here BGR the mixture, can get all the values of our visible light).
If it's a single channel (for example: a grayscale image, there's only one column)
Reference Visible light spectrum:
Because the objects are composed of atoms, the atoms are moving, the games produce light waves, different objects generate light waves, the human retina can be recognized by the optical waves, for the visible band, can be composed of RGB three colors (each 0-255 range).
Therefore, the camera, camera and other imaging, also through the sensor (as shown), to obtain different values, and then storage, the general sensor is to receive RGB three color bands, so the final image storage is also used (RGB) storage. Each of these pixels has an (RGB) value.
In this way, from the very beginning of the imaging principle to understand the picture is generally why according to this kind of storage, it makes sense.
Of course, the specific system files, but also need some headers header information (to be described). Then it will be specific to the various codes (PNG, JPG, etc.) what is the back of the matter.
Reference:
Book: Computer Vision Metric
Opencvdoc
Computer Vision Learning-image Storage format