JPEG File Interchange Format
Encyclopedia
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 JIFs 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".
) to have different resolutions, but it does not 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.
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.
Since 2009, JFIF is under development to be defined as ISO/IEC 10918-5 - JPEG Part 5: JPEG File Interchange Format (JFIF). Ecma International
TR/98 specifies the JPEG File Interchange Format (JFIF); the first edition was published in June 2009.
2046 specified that the image format used for transmitting JPEG images across the internet should be JFIF. The MIME type of "image/jpeg" must be encoded as JFIF. In practice, however, virtually all Internet software can decode any baseline JIF image that uses Y or YCbCr components, whether it is JFIF compliant or not.
In practice, many programs and digital cameras produce files with both application segments included. This will not affect the image decoding for most decoders, but poorly designed JFIF or Exif parsers may not recognise the file properly.
JFIF is compatible with Adobe Photoshop's JPEG "Information Resource Block" extensions, and IPTC Information Interchange Model
metadata, since JFIF does not preclude other application segments, and the Photoshop extensions are not required to be the first in the file. However, Photoshop generally saves CMYK buffers as four-component "Adobe JPEGs" that are not conformant with JFIF. Since these files are not in a YCbCr color space, they are typically not decodable by Web browsers and other Internet software.
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....
(JIF) standard. It solves some of JIFs 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
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....
standard, hence JFIF is sometimes referred to as "JPEG/JFIF".
Purpose
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 CrYCbCr
YCbCr or Y′CbCr, sometimes written or , is a family of color spaces used as a part of the color image pipeline in video and digital photography systems. Y′ is the luma component and CB and CR are the blue-difference and red-difference chroma components...
) to have different resolutions, but it does not define how those differing sample arrays should be aligned. The JFIF standard requires samples to be sited "interstitially
Chroma subsampling
Chroma subsampling is the practice of encoding images by implementing less resolution for chroma information than for luma information, taking advantage of the human visual system's lower acuity for color differences than for luminance....
" — 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.Color space
JPEG does not define which color encodingColor space
A color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values or color components...
is to be used for images. JFIF defines the color model to be used: either Y for greyscale, or YCbCr
YCbCr
YCbCr or Y′CbCr, sometimes written or , is a family of color spaces used as a part of the color image pipeline in video and digital photography systems. Y′ is the luma component and CB and CR are the blue-difference and red-difference chroma components...
as defined by CCIR 601
CCIR 601
ITU-R Recommendation BT.601, more commonly known by the abbreviations Rec. 601 or BT.601 is a standard published in 1982 by International Telecommunication Union - Radiocommunications sector for encoding interlaced analog video signals in digital video form...
. Since this is not an absolute color space
Absolute color space
In color science, there are two meanings of the term absolute color space:* A color space in which the perceptual difference between colors is directly related to distances between colors as represented by points in the color space....
— unless an ICC
International Color Consortium
The International Color Consortium was formed in 1993 by eight industry vendors in order to create a universal color management system that would function transparently across all operating systems and software packages....
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.
History
The standard was established on March 1, 1991 in a meeting at C-Cube Microsystems involving representatives of many companies, including C-Cube Microsystems, Radius, NeXT, Storm Tech, the PD JPEG group, Sun, and Handmade Software. The standard appears to have lost ownership, since C-Cube Microsystems is now defunct, and further development of the standard is dead. The latest version is v1.02, published September 1, 1992.Since 2009, JFIF is under development to be defined as ISO/IEC 10918-5 - JPEG Part 5: JPEG File Interchange Format (JFIF). Ecma International
Ecma International
Ecma International is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's global reach and activities...
TR/98 specifies the JPEG File Interchange Format (JFIF); the first edition was published in June 2009.
MIME Type
In 1996, RFCRequest for Comments
In computer network engineering, a Request for Comments is a memorandum published by the Internet Engineering Task Force describing methods, behaviors, research, or innovations applicable to the working of the Internet and Internet-connected systems.Through the Internet Society, engineers and...
2046 specified that the image format used for transmitting JPEG images across the internet should be JFIF. The MIME type of "image/jpeg" must be encoded as JFIF. In practice, however, virtually all Internet software can decode any baseline JIF image that uses Y or YCbCr components, whether it is JFIF compliant or not.
Exif/Photoshop compatibility
Formally, the Exif and JFIF standards are incompatible. This is because both specify that their particular application segment (APP0 for JFIF, APP1 for Exif) must be the first in the image file.In practice, many programs and digital cameras produce files with both application segments included. This will not affect the image decoding for most decoders, but poorly designed JFIF or Exif parsers may not recognise the file properly.
JFIF is compatible with Adobe Photoshop's JPEG "Information Resource Block" extensions, and IPTC Information Interchange Model
IPTC Information Interchange Model
The Information Interchange Model is a file structure and set of metadata attributes that can be applied to text, images and other media types...
metadata, since JFIF does not preclude other application segments, and the Photoshop extensions are not required to be the first in the file. However, Photoshop generally saves CMYK buffers as four-component "Adobe JPEGs" that are not conformant with JFIF. Since these files are not in a YCbCr color space, they are typically not decodable by Web browsers and other Internet software.
Exif comparison
The newer Exif standard provides almost all the features of the JFIF standard within its feature set. In particular, images can be tagged with an absolute color space, sRGB.File format structure
The JFIF meta data resides in the JPEG Application Segment APP0, having the zero-terminated ASCII string "JFIF" as segment header.JFIF segment format
Field | Size (bytes) | Description |
---|---|---|
APP0 marker | 2 | Always equals 0xFFE0 |
Length | 2 | Length of segment excluding APP0 marker |
Identifier | 5 | Always equals "JFIF" (with zero following) (0x4A46494600) |
Version | 2 | First byte is major version (currently 0x01), Second byte is minor version (currently 0x02) |
Density units | 1 | Units for pixel density fields
|
X density | 2 | Integer horizontal pixel density |
Y density | 2 | Integer vertical pixel density |
Thumbnail width (tw) | 1 | Horizontal size of embedded JFIF thumbnail in pixels |
Thumbnail height (th) | 1 | Vertical size of embedded JFIF thumbnail in pixels |
Thumbnail data | 3 × tw × th | Uncompressed 24 bit RGB raster thumbnail |
JFIF extension (JFXX) segment format
An optional second application segment allows a thumbnail image to be embedded using several different image formats (to save space).Field | Size (bytes) | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
APP0 marker | 2 | Always equals 0xFFE0 | |||||||||||||||||||||||||||
Length | 2 | Length of segment excluding APP0 marker | |||||||||||||||||||||||||||
Identifier | 5 | Always equals "JFXX" (with zero following) (0x4A46585800) | |||||||||||||||||||||||||||
Thumbnail format | 1 | Specifies what data format is used for the thumbnail:
|
|||||||||||||||||||||||||||
Thumbnail data | Variable |
JPEG Must be JIF format using YCbCr or just Y, and must not contain JFIF or JFXX segments.
|
External links
- JPEG File Interchange Format Specification v1.02, September 1, 1992.