The JPEG File Interchange Format (JFIF) is an image file format standard. It is a format for exchanging JPEG encoded files compliant with the JPEG Interchange Format (JIF) standard. It solves some of JIF's limitations in regard to simple JPEG encoded file interchange. As with all JIF compliant files, image data in JFIF files is compressed using the techniques in the JPEG standard, hence JFIF is sometimes referred to as "JPEG/JFIF".
JFIF defines a number of details that are left unspecified by the JPEG Part 1 standard (ISO/IEC IS 10918-1, ITU-T Recommendation T.81):
Component sample registration
JPEG allows multiple components (such as Y, Cb, and Cr) to have different resolutions, but it doesn't define how those differing sample arrays should be aligned. The JFIF standard requires samples to be sited "interstitially" — meaning the decoder can treat each component array as representing an array of equal-sized rectangular pixels sampled in their centers, with each array having the same exterior boundaries as the image. This is convenient for computer users, but is not the alignment used in MPEG-2 and most video applications.
Resolution and aspect ratio
The JPEG standard does not include any method of coding the resolution or aspect ratio of an image. JFIF provides resolution or aspect ratio information using an application segment extension to JPEG. It uses Application Segment #0, with a segment header of 'JFIF\x00', and specifies that this must be the first segment in the file, hence making it simple to recognise a JFIF file. Exif images recorded by digital cameras generally do not include this segment, but typically comply in all other respects with the JFIF standard.
JPEG does not define which color encoding is to be used for images. JFIF defines the color model to be used: either Y for greyscale, or YCbCr as defined by CCIR 601. Since this is not an absolute color space — unless an ICC profile, colorspace metadata, or an sRGB tag is provided and interpreted – a decoded JFIF image will be in a device-dependent RGB colorspace. Hence, JFIF does not by itself provide a mechanism for accurately transporting color-managed images across the Internet.
Full article ▸