At the moment, you might think that you could scan an image point by point and put the samples in a row and that would give you a digital image. Unfortunately it is not allways this straightforward.
In those days when different computer systems weren't able to communicate with each other, all the developers had their own idea of what kind of order the pixels should be stored in. This lead to a large number of incompatible picture formats being developed.

Pixels are arranged in an order specified by the picture format.
When the systems eventually got more closely tied together, headers and trailers had to be included to image files to tell what kind of picture format they implemented.
As times went by, the graphical capability of computers grew tremendously, giving rise to the problem of too large image files. Since a good quality image requires thousands or even millions of pixels it also requires quite a lot of storage space. To minimize the required size, new picture formats with effective compression algorithms were developed. By pressing one of the magnified pixels below you get information about a picture format.