The JPEG File Interchange Format (JFIF) is an
image file format standard published as
ITU-T
The ITU Telecommunication Standardization Sector (ITU-T) is one of the three sectors (divisions or units) of the International Telecommunication Union (ITU). It is responsible for coordinating standards for telecommunications and Information Commu ...
Recommendation T.871 and
ISO/IEC
ISO/IEC JTC 1, entitled "Information technology", is a joint technical committee (JTC) of the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC). Its purpose is to develop, maintain and pr ...
10918-5. It defines supplementary specifications for the
container format
A container format (informally, sometimes called a wrapper) or metafile is a file format that allows multiple data streams to be embedded into a single file, usually along with metadata for identifying and further detailing those streams. Notab ...
that contains the image data encoded with the
JPEG
JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and imag ...
algorithm. The base specifications for a JPEG container format are defined in Annex B of the JPEG standard, known as
JPEG Interchange Format
JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and imag ...
(JIF). JFIF builds over JIF to solve some of JIF's limitations, including unnecessary complexity, component sample registration, resolution, aspect ratio, and
color space
A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represent ...
. Because JFIF is not the original JPG standard, one might expect another mime-type. However, it is still registered as "image/jpeg" (indicating its primary data format rather than the amended information).
JFIF is
mutually incompatible with the newer
Exchangeable image file format (Exif).
Purpose
JFIF defines a number of details that are left unspecified by the JPEG Part 1 standard (
ISO
ISO is the most common abbreviation for the International Organization for Standardization.
ISO or Iso may also refer to: Business and finance
* Iso (supermarket), a chain of Danish supermarkets incorporated into the SuperBest chain in 2007
* Iso ...
/
IEC
The International Electrotechnical Commission (IEC; in French: ''Commission électrotechnique internationale'') is an international standards organization that prepares and publishes international standards for all electrical, electronic and r ...
10918-1,
ITU-T
The ITU Telecommunication Standardization Sector (ITU-T) is one of the three sectors (divisions or units) of the International Telecommunication Union (ITU). It is responsible for coordinating standards for telecommunications and Information Commu ...
Recommendation T.81.)
Component sample registration
JPEG allows multiple components (such as
Y, Cb, and Cr) to have different resolutions, but it does not define how those differing sample arrays (which render bitmaps) should be aligned. The information which produces pixels, is rendered with the expectation of indicating rectangles by their centeroid, rather than being pixel data directly, or being 'first corner and flood', etc. which is uncommon.
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 consisting of the
null-terminated string spelling "JFIF" in
ASCII
ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
followed by a byte equal to 0, and specifies that this must be the first segment in the file, hence making it simple to recognize 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
The JPEG standard used for the compression coding in JFIF files 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 derived from
RGB color primaries as defined in
CCIR 601 (now known as Rec. ITU-R BT.601), except with a different "full range" scaling of the Y, Cb and Cr components. Unlike the "studio range" defined in CCIR 601, in which black is represented by Y=16 and 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
sRGB is a standard RGB (red, green, blue) color space that HP and Microsoft created cooperatively in 1996 to use on monitors, printers, and the World Wide Web. It was subsequently standardized by the International Electrotechnical Commission ( ...
). 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
sRGB is a standard RGB (red, green, blue) color space that HP and Microsoft created cooperatively in 1996 to use on monitors, printers, and the World Wide Web. It was subsequently standardized by the International Electrotechnical Commission ( ...
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
JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and imag ...
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'' '' ata 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 JFIF extension APP0 marker segment. This segment may only be present for JFIF versions 1.02 and above. It allows to embed a thumbnail image in 3 different formats.
The thumbnail data depends on the thumbnail format as follows:
Compatibility
The newer
Exchangeable image file format (Exif) is comparable to JFIF, but the two standards are mutually incompatible. This is because both standards specify that their particular application segment (APP0 for JFIF, APP1 for Exif) must immediately follow the SOI marker. 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
The Information Interchange Model (IIM) is a file structure and set of metadata attributes that can be applied to text, images and other media types. It was developed in the early 1990s by the International Press Telecommunications Council (IPTC) t ...
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.
History
Development of the JFIF document was led by Eric Hamilton of
C-Cube Microsystems
C-Cube Microsystems was an early company in video compression technology as well as the implementation of that technology into semiconductor integrated circuits and systems. C-Cube was the first company to deliver on the market opportunity prese ...
, and agreement on the first version was established in late 1991 at a meeting held at C-Cube involving about 40 representatives of various computer, telecommunications, and imaging companies. Shortly afterwards, a minor revision was published — JFIF 1.01.
For nearly 20 years, the latest version available was v1.02, published September 1, 1992.
In 1996,
RFC
RFC may refer to:
Computing
* Request for Comments, a memorandum on Internet standards
* Request for change, change management
* Remote Function Call, in SAP computer systems
* Rhye's and Fall of Civilization, a modification for Sid Meier's Civ ...
2046 specified that the image format used for transmitting JPEG images across the internet should be JFIF. The
MIME type
A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority, Internet Assigned Numbers Authority (IANA) is the official authority for t ...
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.
As time went by, C-Cube was restructured (and eventually devolved into
Harmonic
A harmonic is a wave with a frequency that is a positive integer multiple of the ''fundamental frequency'', the frequency of the original periodic signal, such as a sinusoidal wave. The original signal is also called the ''1st harmonic'', the ...
,
LSI Logic
LSI Logic Corporation, an American company founded in Milpitas, California, was a pioneer in the ASIC and EDA industries. It evolved over time to design and sell semiconductors and software that accelerated storage and networking in data cente ...
,
Magnum Semiconductor
Magnum Semiconductor Inc. was a video compression technology company headquartered in Milpitas, California, and with an engineering branch at Waterloo, Ontario, Canada. It traded under the Magnum Semiconductor name between its foundation in 2003 ...
,
Avago Technologies,
Broadcom, and GigOptix, GigPeak, etc), and lost interest in the document, and the specification had no official publisher until it was picked up by
Ecma International and the ITU-T/ISO/IEC
Joint Photographic Experts Group around 2009 to avoid it being lost to history and provide a way to formally cite it in standard publications and improve its editorial quality. It was published by ECMA in 2009 as Technical Report number 98 to avoid loss of the historical record,
and it was formally standardized by
ITU-T
The ITU Telecommunication Standardization Sector (ITU-T) is one of the three sectors (divisions or units) of the International Telecommunication Union (ITU). It is responsible for coordinating standards for telecommunications and Information Commu ...
in 2011 as its Recommendation T.871
and by ISO/IEC in 2013 as ISO/IEC 10918-5,
The newer publications included editorial improvements but no substantial technical changes.
See also
*
Joint Photographic Experts Group
References
Further reading
Books
* Miano, John M, "Compressed Image File Formats"; 1999, Addison-Wesley
* Pennebaker, William B. and
Joan L. Mitchell
Joan Laverne Mitchell (May 24, 1947 – December 2, 2015) was an American computer scientist, data compression pioneer, and inventor who, as a researcher at IBM, co-invented the JPEG digital image format.
Early life
Mitchell was born on M ...
: ''JPEG still image data compression standard''; 3rd edition, 1993, Springer {{ISBN, 978-0-442-01272-4
Standards
* Hamilton, Eric
''JPEG File Interchange Format, Version 1.02''(PDF, 0.02 MB) 1 September 1992
* Recommendation ITU-T T.871
''Information technology – Digital compression and coding of continuous-tone still images: JPEG File Interchange Format (JFIF)''(PDF and Microsoft Word, 0.2 MB) Approved 14 May 2011; posted 11 September 2012
* Recommendation ITU-T T.81
''Information technology – Digital compression and coding of continuous-tone still images – Requirements and guidelines''(PDF and Microsoft Word, 1.5 MB) Approved 18 September 1992; posted 14 April 2004
JFIF
Graphics file formats
Open formats