white by Y=235 and values outside of this range are available for signal processing "headroom" and "footroom", JFIF uses all 256 levels of the 8-bit representation, so that Y=0 for black and Y=255 for peak white. The RGB color primaries defined in JFIF via CCIR 601 also differ somewhat from what has become common practice in newer applications (e.g., they differ slightly from the color primaries defined in sRGB). Moreover, CCIR 601 (before 2007) did not provide a precise definition of the RGB color primaries; it relied instead on the underlying practices of the television industry. Color interpretation of a JFIF image may be improved by embedding an ICC profile, colorspace metadata, or an sRGB tag, and using an application that interprets this information. File format structure A JFIF file consists of a sequence of markers or marker segments (for details refer to JPEG, Syntax and structure). The markers are defined in part 1 of the JPEG Standard. Each marker consists of two bytes: an FF byte followed by a byte which is not equal to 00 or FF and specifies the type of the marker. Some markers stand alone, but most indicate the start of a marker segment that contains data bytes according to the following pattern: FF xx s1 s2 [data bytes] The bytes s1 and s2 are taken together to represent a big-endian 16-bit integer specifying the length of the following "data bytes" plus the 2 bytes used to represent the length. In other words, s1 and s2 specify the number of the following data bytes as . According to part 1 of the JPEG standard, applications can use APP marker segments and define an application specific meaning of the data. In the JFIF standard, the following APP marker segments are defined: JFIF APP0 marker segment (JFIF segment for short) (mandatory) JFIF extension APP0 marker segment (JFXX segment for short) (optional) They are described below. The JFIF standard requires that the JFIF APP0 marker segment immediately follows the SOI marker. If a JFIF extension APP0 marker segment is used, it must immediately follow the JFIF APP0 marker segment. So a JFIF file will have the following structure: JFIF APP0 marker segment In the mandatory JFIF APP0 marker segment the parameters of the image are specified. Optionally an uncompressed thumbnail can be embedded. JFIF extension APP0 marker segment Immediately following the JFIF APP0 marker segment may be a