I n t e r n a t i o n a l

T e l e c o m m u n i c a t i o n

ITU-T
TELECOMMUNICATIONSTANDARDIZATION SECTOR
OF ITUU n i o n

T.871
(05/2011)

SERIES T: TERMINALS FOR TELEMATIC SERVICES
Still-image compression – JPEG-1 extensions

Information technology – Digital compression
and coding of continuous-tone still images:
JPEG File Interchange Format (JFIF)

Recommendation ITU-T T.871

ITU-T T-SERIES RECOMMENDATIONSTERMINALS FOR TELEMATIC SERVICES
Facsimile – Framework
Still-image compression – Test charts
Facsimile – Group 3 protocols
Colour representation
Character coding
Facsimile – Group 4 protocols
Telematic services – Framework
Still-image compression – JPEG-1, Bi-level and JBIG
Telematic services – ISDN Terminals and protocols
Videotext – Framework
Data protocols for multimedia conferencing
Telewriting
Multimedia and hypermedia framework
Cooperative document handling
Telematic services – Interworking
Open document architecture
Document transfer and manipulation
Document application profile
Communication application profile
Telematic services – Equipment characteristics
Still-image compression – JPEG 2000
Still-image compression – JPEG XR
Still-image compression – JPEG-1 extensions
For further details, please refer to the list of ITU-T Recommendations.

T.0–T.19
T.20–T.29
T.30–T.39
T.40–T.49
T.50–T.59
T.60–T.69
T.70–T.79
T.80–T.89
T.90–T.99
T.100–T.109
T.120–T.149
T.150–T.159
T.170–T.189
T.190–T.199
T.300–T.399
T.400–T.429
T.430–T.449
T.500–T.509
T.510–T.559
T.560–T.649
T.800–T.829
T.830–T.849
T.850–T.899

INTERNATIONAL STANDARD ISO/IEC 10918-5
RECOMMENDATION ITU-T T.871

Information technology – Digital compression
and coding of continuous-tone still images:
JPEG File Interchange Format (JFIF)

Summary
Recommendation ITU-T T.871 | ISO/IEC 10918-5 specifies a file format, referred to as the JPEG File Interchange
Format (JFIF), for file-based interchange of images encoded according to the JPEG image coding standard(Recommendation ITU-T T.81 | ISO/IEC 10918-1). This Recommendation | International Standard is substantially basedon the JFIF version 1.02 specification that was produced in 1992. The JFIF version 1.02 specification was widely andfreely circulated, and became widely recognized as a de facto standard. This Recommendation | International Standard
was developed primarily to formalize the JFIF version 1.02 specification.

History
Edition
1.0

Recommendation
ITU-T T.871

Approval
2011-05-14

Study Group16

Rec. ITU-T T.871 (05/2011)i

FOREWORD
The International Telecommunication Union (ITU) is the United Nations specialized agency in the field of
telecommunications, information and communication technologies (ICTs). The ITU Telecommunication
Standardization Sector (ITU-T) is a permanent organ of ITU. ITU-T is responsible for studying technical,
operating and tariff questions and issuing Recommendations on them with a view to standardizing
telecommunications on a worldwide basis.
The World Telecommunication Standardization Assembly (WTSA), which meets every four years,
establishes the topics for study by the ITU-T study groups which, in turn, produce Recommendations onthese topics.
The approval of ITU-T Recommendations is covered by the procedure laid down in WTSA Resolution 1.
In some areas of information technology which fall within ITU-T's purview, the necessary standards areprepared on a collaborative basis with ISO and IEC.

NOTE
In this Recommendation, the expression "Administration" is used for conciseness to indicate both atelecommunication administration and a recognized operating agency.
Compliance with this Recommendation is voluntary. However, the Recommendation may contain certain
mandatory provisions (to ensure, e.g., interoperability or applicability) and compliance with the
Recommendation is achieved when all of these mandatory provisions are met. The words "shall" or someother obligatory language such as "must" and the negative equivalents are used to express requirements. The
use of such words does not suggest that compliance with the Recommendation is required of any party.

INTELLECTUAL PROPERTY RIGHTSITU draws attention to the possibility that the practice or implementation of this Recommendation may
involve the use of a claimed Intellectual Property Right. ITU takes no position concerning the evidence,
validity or applicability of claimed Intellectual Property Rights, whether asserted by ITU members or others
outside of the Recommendation development process.
As of the date of approval of this Recommendation, ITU had not received notice of intellectual property,
protected by patents, which may be required to implement this Recommendation. However, implementers
are cautioned that this may not represent the latest information and are therefore strongly urged to consult the
TSB patent database at http://www.itu.int/ITU-T/ipr/.

 ITU 2012
All rights reserved. No part of this publication may be reproduced, by any means whatsoever, without theprior written permission of ITU.

ii

Rec. ITU-T T.871 (05/2011)Table of Contents
Page
1

Scope ..............................................................................................................................................................

1

2

Normative references .....................................................................................................................................
2.1
Identical Recommendations | International Standards ........................................................................
2.2
Paired Recommendations | International Standards equivalent in technical content...........................
2.3
Additional references ..........................................................................................................................

1
1
1
1

3

Definitions ......................................................................................................................................................

1

4

Abbreviations .................................................................................................................................................

1

5

Conformance ..................................................................................................................................................

2

6

JPEG File Interchange Format (JFIF) overview .............................................................................................
6.1
JPEG compression ..............................................................................................................................
6.2
Colour space ........................................................................................................................................
6.3
JFIF APP0 marker segment .................................................................................................................
6.4
APP0 marker used to specify JFIF extensions .....................................................................................
6.5
Application marker segments used for application-specific information ............................................

2
2
2
3
3
3

7

Conversion to and from RGB .........................................................................................................................

3

8

Image orientation ............................................................................................................................................

4

9

Spatial relationship of components.................................................................................................................

4

10

JPEG File Interchange Format (JFIF) specification .......................................................................................
10.1 JFIF file syntax....................................................................................................................................
10.2 JFIF extension APP0 marker segment .................................................................................................
10.3 JFIF extension: Thumbnail coded using JPEG encoding ....................................................................
10.4 JFIF extension: Thumbnail stored using one byte per pixel ................................................................
10.5 JFIF extension: Thumbnail stored using three bytes per pixel ............................................................

6
6
7
7
8
8

Bibliography ..............................................................................................................................................................

9

Rec. ITU-T T.871 (05/2011)iii

ISO/IEC 10918-5:2012 (E)INTERNATIONAL STANDARD
RECOMMENDATION ITU-T

Information technology – Digital compression
and coding of continuous-tone still images:
JPEG File Interchange Format (JFIF)
1

Scope

This Recommendation | International Standard specifies the JPEG File Interchange Format (JFIF).
The JPEG File Interchange Format (JFIF) is a minimal file format which enables the exchange of JPEG encoded images(according to Rec. ITU-T T.81 | ISO/IEC 10918-1) having 1 or 3 colour channels and 8 bits per colour channel between
a wide variety of platforms and applications. This minimal format does not include some advanced features found invarious other specified file formats. The purpose of this format is to provide for a basic form of exchange of JPEG
images. The optional inclusion of thumbnail images for rapid browsing is also supported.

2

Normative references

The following Recommendations and International Standards contain provisions which, through reference in this text,
constitute provisions of this Recommendation | International Standard. At the time of publication, the editions indicatedwere valid. All Recommendations and Standards are subject to revision, and parties to agreements based on thisRecommendation | International Standard are encouraged to investigate the possibility of applying the most recent
edition of the Recommendations and Standards listed below. Members of IEC and ISO maintain registers of currently
valid International Standards. The Telecommunication Standardization Bureau of the ITU maintains a list of currently
valid ITU-T Recommendations.

2.1

Identical Recommendations | International Standards–

2.2

Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994, Information technology – Digitalcompression and coding of continuous-tone still images – Requirements and guidelines.

Paired Recommendations | International Standards equivalent in technical content

None.

2.3

Additional references–

3

Recommendation ITU-R BT.601-6 (2007), Studio encoding parameters of digital television forstandard 4:3 and wide screen 16:9 aspect ratios.

Definitions

For the purposes of this Recommendation | International Standard, the following definitions apply.
3.1
JPEG File Interchange Format (JFIF): The interchange format specified in this Recommendation |International Standard for exchange of images encoded according to the JPEG standard (Rec. ITU-T T.81 |ISO/IEC 10918-1) having 1 or 3 colour channels and 8 bits per colour channel.
3.2
thumbnail: Reduced resolution representation of the main JPEG (Rec. ITU-T T.81 | ISO/IEC 10918-1) coded
image that can be used to identify the image by its content.
NOTE – Thumbnails are commonly used to browse multiple images quickly using a low resolution visual representation of theimages, rather than using file names or other metadata.

4

Abbreviations

For the purposes of this Recommendation | International Standard, the following abbreviations apply.
Api

Byte i of application data

APP0

Application data marker, type 0

Rec. ITU-T T.871 (05/2011)1

ISO/IEC 10918-5:2012 (E)5EOI

End of ImageICCInternational Color Consortium

JFIF

JPEG File Interchange Format

JPEG

Joint Photographic Experts Group

Lf

Length of frame header

Lp

Length of application data segment

Nf

Number of components in frame

RGB

Red, Green, and Blue (colour component values)

SOF

Start of Frame

SOI

Start of ImageYCBCRLuminance (denoted as Y), Chrominance toward Blue, and Chrominance toward Red (colour
component values)

Conformance

Some requirements in this Recommendation | International Standard are expressed as format or syntax requirements
rather than as software or hardware implementation requirements. Implementations fall into two categories: JFIF
decoders and JFIF encoders.
In order for a JFIF decoder to be considered conforming, the decoder shall not report errors when processing
conforming instances of the specified format, except when forced to do so by resource exhaustion or when the encoded
image data uses non-baseline features of Rec. ITU-T T.81 | ISO/IEC 10918-1 that are not supported by the decoder.
NOTE – The decoder should report errors when processing non-conforming deviations from the specified format.

In order for a JFIF encoder to be considered conforming, the files produced by the encoder shall be formatted as
specified.

6

JPEG File Interchange Format (JFIF) overview

6.1

JPEG compression

Any JPEG (Rec. ITU-T T.81 | ISO/IEC 10918-1) process is supported by the syntax of the JPEG File Interchange
Format (JFIF), provided the encoded image has 1 or 3 colour channels and 8 bits per colour channel.
NOTE 1 – It is strongly recommended that the JPEG baseline process, as defined in Rec. ITU-T T.81 | ISO/IEC 10918-1, be used
for the purposes of file interchange. This ensures maximum compatibility among applications supporting JPEG coded images.

Files conforming to the JPEG File Interchange Format shall conform to the interchange format specified inRec. ITU-T T.81 | ISO/IEC 10918-1. The encoded image in the JPEG File Interchange Format shall have 1 or 3 colour
channels and 8 bits per colour channel. Additionally, the JFIF APP0 marker (see 6.4) shall be present immediately
following the SOI marker (specified in Rec. ITU-T T.81 | ISO/IEC 10918-1).
NOTE 2 – The interchange format specified in Rec. ITU-T T.81 | ISO/IEC 10918-1 requires that all table specifications used in
the encoding process are coded in the image data prior to their use.

6.2

Colour space

The colour space to be used is YCBCR as defined by Rec. ITU-R BT.601 (256 levels) but with a different scaling as
specified below. If only one component is used, that component shall be the Y component channel as specified below.
NOTE – The colour space specification herein can provide only a basic level of colour fidelity. The use of supplemental metadata
such as an ICC profile (e.g., as specified in ISO 15076-1) may be necessary to provide a more accurate colour characterization.

If three components are used, they shall be present in the image with the ordering of the components such that the firstcomponent is the Y channel, the second component is the CB channel, and the third component is the CR channel.

2Rec. ITU-T T.871 (05/2011)ISO/IEC 10918-5:2012 (E)

6.3

JFIF APP0 marker segment

The JFIF APP0 marker segment shall immediately follow the SOI marker. The JFIF APP0 marker segment is defined as
an APP0 marker (specified in Rec. ITU-T T.81 | ISO/IEC 10918-1) containing the null-terminated string: "JFIF"
encoded as specified in 10.1 in the first five application data bytes of the marker segment (Api, for i = 1 to 5).
Additional APP0 marker segments may also be present, provided the associated application data bytes do not begin withthis string. The JFIF APP0 marker segment provides some information that is not contained in the JPEG
(Rec. ITU-T T.81 | ISO/IEC 10918-1) stream, such as: version number, horizontal and vertical pixel densities(expressed in dots per inch or dots per cm), pixel aspect ratio (derived from the horizontal and vertical pixel densities),and an optional thumbnail encoded as 24-bit RGB image data.
NOTE – The "JFIF" string as specified in 10.1 is encoded according to Rec. ITU-T T.50 | ISO 646.

6.4

APP0 marker used to specify JFIF extensions

Additional APP0 marker segment(s) can optionally be used for the JFIF extensions specified in clause 10. If used, thesesegment(s) must immediately follow the JFIF APP0 marker segment. Decoders shall skip any unsupported JFIF
extension segments and continue decoding. The JFIF extension APP0 marker is identified by the zero-terminated string"JFXX" encoded as specified in 10.2 in the first five application data bytes of the marker segment (Api, for i = 1 to 5).
The JFIF extension APP0 marker segment contains a 1-byte code with a value specified in clause 10 that identifies theparticular extension type.
NOTE – The encoding of the "JFXX" string as specified in 10.2 is encoded according to Rec. ITU-T T.50 | ISO 646.

6.5

Application marker segments used for application-specific information

Additional APP0 and other application marker segments may be used to hold application-specific information that does
not affect the ability to decode or display the JFIF file segment. Application-specific marker segments must appear after
the JFIF APP0 and any JFIF extension APP0 marker segments. Application-specific APP0 marker segments shall containapplication data bytes such that the initial application data bytes contain a zero-terminated string value that identifies theapplication. For application-specific APP0 marker segments, this string shall not be the zero-terminated string values"JFIF" as specified in 10.1 or "JFXX" as specified in 10.2, to avoid conflict with this Recommendation | International
Standard. It is recommended that this string represent an organization name or company trademark. Generic strings
such as "dog", "cat", "tree", etc., should not be used.

7

Conversion to and from RGB

The interpretations of Y, CB, and CR are derived from the E'Y, E'CB, and E'CR signals defined in the 625-line specificationof Rec. ITU-R BT.601, but these signals are normalized so as to permit the usage of the full range of 256 levels of the
8-bit binary encoding of the Y component. More precisely, they are specified by the following relationships:
Y = Min( Max( 0, Round( 255 * E'Y ) ), 255 )CB = Min( Max( 0, Round( 255 * E'CB + 128 ) ), 255 )CR = Min( Max( 0, Round( 255 * E'CR + 128 ) ), 255 )using the following mathematical definitions:
Round( x ) = x + 0.5 

x ; x ≤ yy ; x > yMin( x, y ) = 

x ; x ≥ yy ; x < yMax( x, y ) = 

where the E'Y, E'CB and E'CR are defined as in Rec. ITU-R BT.601. Values of E'Y have a nominal range of 0.0 to 1.0 and
those for E'CB and E'CR have a nominal range of –0.5 to +0.5 for conventional colorimetry. The values of Y, CB, and CR
must be clamped to the range from 0 to 255 as shown above. YCBCR colours (with 256 levels per component) canalternatively be computed directly from full scale 8-bit per colour channel RGB colours in which black is represented by(0, 0, 0) and white is represented by (255, 255, 255) by using the following formulae:

Rec. ITU-T T.871 (05/2011)3

ISO/IEC 10918-5:2012 (E)Y= Min( Max( 0, Round(

0.299 * R + 0.587 * G + 0.114 * B

CB= Min( Max( 0, Round( ( − 0.299 * R − 0.587 * G + 0.886 * B ) / 1.772 + 128 ) ), 255 )CR= Min( Max( 0, Round( () ), 255 )0.701 * R − 0.587 * G − 0.114 * B ) / 1.402 + 128 ) ), 255 )which, to four decimal position accuracy, can be approximated by:Y= Min( Max( 0, Round(

0.299 * R + 0.587 * G

CB= Min( Max( 0, Round( − 0.1687 * R− 0.3313 * G

CR= Min( Max( 0, Round(− 0.4187 * G − 0.0813 * B

0.5

*R

+ 0.114 * B+ 0.5) ), 255 )* B + 128 ) ), 255 )+ 128 ) ), 255 )NOTE 1 − Not all image file formats store image samples in the order R0, G0, B0, ... Rn, Gn, Bn. The sample order must be verified
before converting an RGB file to JFIF.

The inverse relationship for computing full scale 8-bit per colour channel gamma pre-corrected RGB values (following
Rec. ITU-R BT.601 gamma pre-correction and colour primary specifications) from YCBCR colours (with 256 levels percomponent) can be computed as follows:R= Min( Max( 0, Round( Y+ 1.402 * ( C R − 128 )) ), 255)

G = Min( Max( 0, Round( Y − ( 0.114 * 1.772 * ( C B − 128 ) + 0.299 * 1.402 * ( C R − 128 ) ) / 0.587 ) ), 255)
B

= Min( Max( 0, Round( Y+ 1.772 * ( C B − 128 )) ), 255)

which, to four decimal position accuracy, can be approximated by:R= Min( Max( 0, Round( YG = Min( Max( 0, Round( YB= Min( Max( 0, Round( Y+1.402 * ( C R − 128 ) ) ), 255 )− 0.3441* ( C B − 128 ) − 0.7141 * ( C R − 128 ) ) ), 255 )+ 1.772 * ( C B − 128 )) ), 255 )The RGB values used for representation of thumbnails stored in JFIF files as specified in clauses 10.1, 10.4, or 10.5 areinterpreted according to this full-scale (256 levels per component) convention, in which black is represented by (0, 0, 0)
and white is represented by (255, 255, 255).
NOTE 2 − The definition of 8-bit per colour channel RGB values in digital form as used in these equations differs from the oneused in Rec. ITU-R BT.601, as the definition used here assumes full-scale 256-level usage in which black is represented by(0, 0, 0) and white is represented by (255, 255, 255), whereas in Rec. ITU-R BT.601, nominal RGB black is represented by(16, 16, 16) and nominal white is represented by (235, 235, 235).
NOTE 3 − As this Recommendation | International Standard is based on the prior informally-circulated JFIF version 1.02
specification that was produced in 1992, which referenced Rec. ITU-R BT.601 (formerly CCIR 601), it references thatspecification for definition of the E'Y, E'CB, and E'CR signals that correspond to the YCBCR values specified herein. However,since the development of the prior JFIF version 1.02 specification, additional industry specifications have been developed, Rec.
ITU-R BT.601 has been updated, and common industry practice has emerged which often follows the sYCC specification in IEC
61966-2-1/Amd.1. The difference between the use of the colour interpretation specification in this Recommendation |International Standard and that of the sYCC specification may be considered negligible in practice. Moreover, as previously
noted, the colour space specification herein can provide only a basic level of colour fidelity. The use of supplemental metadata
such as an ICC profile (e.g., as specified in ISO 15076-1) may be necessary to provide a more accurate colour characterization.

8

Image orientation

In JFIF files, the image orientation is always top-down (in terms of human viewing intent). This means that the firstimage samples encoded in a JFIF file are located in the upper left hand corner of the image and encoding proceeds fromleft to right and top to bottom. Top-down orientation is used for both full resolution images and thumbnails. The processof converting an image file having bottom-up orientation to JFIF should include inverting the order of all image lines
before Rec. ITU-T T.81 | ISO/IEC 10918-1 encoding.

9

Spatial relationship of components

Specification of the spatial positioning of pixel samples within components relative to the samples of other components
is necessary for proper image post processing and accurate image presentation. In JFIF files, the position of the pixels in
sub-sampled components is defined with respect to the highest resolution component. Since components must be
sampled orthogonally (along rows and columns), the spatial position of the samples in a given sub-sampled component
may be determined by specifying the horizontal and vertical offsets of the first sample, i.e., the sample in the upper left
corner, with respect to the highest-resolution component.

4

Rec. ITU-T T.871 (05/2011)ISO/IEC 10918-5:2012 (E)The horizontal and vertical offsets of the position of the first sample in a sub-sampled component, Hoffseti[0,0] andVoffseti[0,0], relative to the position of the upper left sample for the largest component, are defined as follows:
Hoffseti[0,0] = ( Nsamplesref / Nsamplesi ) / 2 − 0.5
Voffseti[0,0] = ( Nlinesref / Nlinesi ) / 2 − 0.5
where:
Nsamplesref is the number of samples per line in the largest component;
Nsamplesi is the number of samples per line in the i-th component;
Nlinesref is the number of lines in the largest component;
Nlinesi is the number of lines in the i-th component.
As used here, the division operator "/" produces a real-valued result without truncation or rounding.
NOTE 1 – Proper sub-sampling of components incorporates an anti-aliasing filter, which reduces the spectral bandwidth of a full
resolution component prior to sub-sampling of that component. Sub-sampling can easily be accomplished using a symmetrical
digital filter with an even number of taps (coefficients). A commonly used filter for 2:1 sub sampling utilizes two taps (1/2, 1/2).

As an example, consider a three-component image which is comprised of components having the following dimensions:–Component 1: 256 samples, 288 lines;–

Component 2: 128 samples, 144 lines;–

Component 3: 64 samples, 96 lines.

For a JFIF file, the centres of the samples of such an image would be positioned as illustrated below in Figure 1:

Component 1

Component 2

Component 3
T.871(11)_F01

Figure 1 – Centres of the samples of three components
NOTE 2 – While this definition matches some industry specifications, it differs from the convention used for CB and CR colour
component sub-sampling in Rec. ITU-R BT.601 and a number of other digital video formats. In practice, the difference may beconsidered negligible, or pre-processing of the chrominance components may be performed to produce a more accurate
reconstruction of the compressed image.
NOTE 3 – In common industry usage, only two forms of colour component sub-sampling are typically encountered in practicefor three-component images. The most common of these forms is known as 4:2:0, in which the CB and CR colour components are
sub-sampled by a factor of two in both the horizontal and vertical dimensions. The other relatively-common form is known as
4:2:2, in which the CB and CR colour components are sub-sampled by a factor of two in the horizontal dimension only. The 4:2:2
form of sub-sampling is used primarily for video-related applications (especially with the use of interlaced-scan systems). For
JFIF usage, the use of sub-sampling formats other than 4:2:0 is therefore discouraged, as such other formats may not be
supported in some applications.

Rec. ITU-T T.871 (05/2011)5

ISO/IEC 10918-5:2012 (E)10JPEG File Interchange Format (JFIF) specification

10.1

JFIF file syntax

The syntax of a JFIF file shall conform to the syntax for the interchange format as specified in Annex B of
Rec. ITU-T T.81 | ISO/IEC 10918-1. In addition, a JFIF file shall contain APP0 marker segments with certain parameter
constraints in the frame header as specified below. Values are represented using unsigned binary representations except
as otherwise specified. X'nn' indicates a byte value in hexadecimal notation. Fields that follow the Lp parameter as
specified below shall appear in the sequence listed below in the application data bytes Api of the JFIF APP0 marker
segment.
X'FF', SOI
X'FF', APP0, Lp, identifier, version, units, Hdensity, Vdensity, HthumbnailA, VthumbnailA, (RGB) * n
Lp(2 bytes)

Total APP0 field byte count, including the byte count value(2 bytes), but excluding the APP0 marker itself. Shall be equal
to 16 + 3 * k, with k = HthumbnailA * VthumbnailA.

identifier(5 bytes)= X'4A', X'46', X'49', X'46', X'00'
This zero-terminated string ("JFIF", according toRec. ITU-T T.50 or ISO 646 coding) identifies the JFIF APP0
marker.

version(2 bytes)= X'0102'
The most significant byte is used for major revisions, the leastsignificant byte for minor revisions. Files encoded according tothis Recommendation | International Standard shall use thevalue X'0102' (corresponding to version 1.02).

units(1 byte)Units for the H (horizontal) and V (vertical) densities:= X'00': units unspecified; H and V densities, expressed in
dots per arbitrary unit, specify only the pixel aspectratio (width:height pixel aspect ratio =Vdensity:Hdensity).
= X'01': H and V densities are dots per inch (dots per
2.54 cm).
= X'02': H and V densities are dots per cm.

Hdensity(2 bytes)

Horizontal pixel density. Must be non-zero.

Vdensity(2 bytes)

Vertical pixel density. Must be non-zero.

HthumbnailA(1 byte)Horizontal thumbnail pixel count. May be zero.

VthumbnailA(1 byte)Vertical thumbnail pixel count. May be zero.

(RGB) * k

(3 * k bytes)

Packed (byte-interleaved) 24-bit RGB values (8 bits per colour
channel) for the thumbnail pixels, in the order R0, G0, B0, ... Rk,
Gk, Bk, with k = HthumbnailA * VthumbnailA.

[ Optional JFIF extension APP0 marker segment(s) – see below ]
•
•
•

6

Rec. ITU-T T.871 (05/2011)ISO/IEC 10918-5:2012 (E)X'FF', SOFn, Lf, etc., according to the interchange format of Annex B of Rec. ITU-T T.81 |ISO/IEC 10918-1, with constraints as follows:
Number of components

Nf= 1 or 3

1st component

C1= 1 = Y component

2nd component (when Nf = 3)

C2

= 2 = CB component (when present)

3rd component (when Nf = 3)C3

= 3 = CR component (when present)•••
X'FF', EOI
If HthumbnailA or VthumbnailA is equal to zero, this indicates that the thumbnail is not present in the marker segment.

10.2

JFIF extension APP0 marker segment

One or more JFIF extension APP0 markers may immediately follow the JFIF APP0 marker segment. The syntax of the
JFIF extension APP0 marker segment shall be as follows. Fields that follow the Lp parameter as specified below shallappear in the sequence listed below in the application data bytes Api of the JFIF extension APP0 marker segment.
X'FF', APP0, Lp, identifier, extension_code, extension_dataLp(2 bytes)

Total APP0 field byte count, including the byte count value (2bytes), but excluding the APP0 marker itself. Shall be equal to thenumber of bytes of extension_data plus 8.

identifier(5 bytes)= X'4A', X'46', X'58', X'58', X'00'
This zero-terminated string ("JFXX", according toRec. ITU-T T.50 or ISO 646 coding) identifies the JFIF extension
APP0 marker.

extension_code(1 byte)Code that identifies the extension. In this version, the following
extensions are defined (see 10.3-10.5 for detailed definitions):

extension_data

10.3(variable)= X'10'Thumbnail coded according to the baseline process
specification in Rec. ITU-T T.81 | ISO/IEC 10918-1(see 10.3).

= X'11'

Uncompressed 8-bit palette RGB thumbnail (see 10.4).

= X'13'

Uncompressed 24-bit RGB thumbnail (see 10.5).

The remainder of the JFIF extension APP0 marker segment,
which varies according to the extension_code. See below for a
specification of extension_data content for each extension.

JFIF extension: Thumbnail coded using JPEG encodingThis extension supports thumbnails encoded using the baseline process specification in Rec. ITU-T T.81 |ISO/IEC 10918-1. The encoded thumbnail is placed in the extension_data field.
The syntax of the content of the extension_data shall conform to the syntax for the interchange format defined in
Annex B of Rec. ITU-T T.81 | ISO/IEC 10918-1. However, no JFIF or JFIF extension marker segments shall be present
within the thumbnail data. As in the full resolution image of the JFIF file, the syntax within the extension_data shall be
constrained as specified below:
X'FF', SOI•••

Rec. ITU-T T.871 (05/2011)7

ISO/IEC 10918-5:2012 (E)X'FF', SOFn, Lf, etc., according to the interchange format of Annex B of Rec. ITU-T T.81 |ISO/IEC 10918-1, with constraints as follows:
Number of components

Nf= 1 or 3

1st component

C1= 1 = Y component

2nd component (when Nf = 3)

C2

= 2 = CB component (when present)

3rd component (when Nf = 3)C3

= 3 = CR component(when present)•••
X'FF', EOI
The number of components of the JPEG (Rec. ITU-T T.81 | ISO/IEC 10918-1) encoded thumbnail may be different
from the number of components for the main image.

10.4

JFIF extension: Thumbnail stored using one byte per pixelThis extension supports thumbnails stored using one byte per pixel and a colour palette in the extension_data field. The
syntax of the content of the extension_data shall be as follows:

10.5

HthumbnailB(1 byte)Horizontal thumbnail pixel count. Must be non-zero.

VthumbnailB(1 byte)Vertical thumbnail pixel count. Must be non-zero.

Palette(768 bytes)

24-bit RGB pixel values for the colour palette. The RGB
values define the colours represented by each value of an
8-bit binary encoding (0-255).

(pixel) * m(m bytes)

8-bit palette indices for the thumbnail pixels
m = HthumbnailB * VthumbnailB.

JFIF extension: Thumbnail stored using three bytes per pixelThis extension supports thumbnails stored using three bytes per pixel in the extension_data field. The syntax of thecontent of the extension_data shall be as follows:
HthumbnailC(1 byte)Horizontal thumbnail pixel count. Must be non-zero.

VthumbnailC(1 byte)Vertical thumbnail pixel count. Must be non-zero.

(RGB) * n

(3 * n bytes)

Packed (byte-interleaved) 24-bit RGB values (8 bits percolour channel) for the thumbnail pixels, in the order R0, G0,
B0, ... Rn, Gn, Bn, withn = HthumbnailC * VthumbnailC.

NOTE – The format of the thumbnail described in this clause is the same as the format of the thumbnail optionally carried in the
JFIF marker segment and described in 10.1.

8

Rec. ITU-T T.871 (05/2011)ISO/IEC 10918-5:2012 (E)Bibliography(This annex does not form an integral part of this Recommendation | International Standard.)[1]

JPEG File Interchange Format specification v1.02, informal publication edited by Eric Hamilton of C-Cube
Microsystems, 1 September, 1992.
http://www.w3.org/Graphics/JPEG/jfif3.pdf[2]

IEC 61966-2-1:1999/Amd.1:2003, Multimedia systems and equipment – Colour measurement andmanagement – Part 2-1: Colour management – Default RGB colour space – sRGB – Amendment 1: sYCC
and bg-sYCC.

[3]

ISO 15076-1:2005, Image technology colour management – Architecture, profile format and data structure –Part 1: Based on ICC.1:2004-10.

[4]

ISO 646:1991, Information technology – ISO 7-bit coded character set for information interchange.

[5]

Recommendation ITU-T T.50 (1992), International Reference Alphabet (IRA) (Formerly International
Alphabet No. 5 or IA5) – Information technology – 7-bit coded character set for information interchange.

Rec. ITU-T T.871 (05/2011)9

SERIES OF ITU-T RECOMMENDATIONS
Series A

Organization of the work of ITU-T

Series D

General tariff principles

Series E

Overall network operation, telephone service, service operation and human factors

Series F

Non-telephone telecommunication services

Series G

Transmission systems and media, digital systems and networks

Series H

Audiovisual and multimedia systems

Series I

Integrated services digital network

Series J

Cable networks and transmission of television, sound programme and other multimedia signals

Series K

Protection against interference

Series L

Construction, installation and protection of cables and other elements of outside plant

Series M

Telecommunication management, including TMN and network maintenance

Series N

Maintenance: international sound programme and television transmission circuits

Series O

Specifications of measuring equipment

Series P

Terminals and subjective and objective assessment methods

Series Q

Switching and signalling

Series R

Telegraph transmission

Series S

Telegraph services terminal equipment

Series T

Terminals for telematic services

Series U

Telegraph switching

Series V

Data communication over the telephone network

Series X

Data networks, open system communications and security

Series Y

Global information infrastructure, Internet protocol aspects and next-generation networks

Series Z

Languages and general software aspects for telecommunication systems

Printed in Switzerland
Geneva, 2012