Normally picture files contain a header before the main section of data, this header tells the operating system/application the format/encoding of the picture (jpg, png, gif, etc), the resolution of the picture, the number of bits used for a single pixel (which determines how many colours could be used) and other details about the construction of the picture.