JPEG File Interchange Format

from Wikipedia, the free encyclopedia
JPEG File Interchange Format
Photo of a flower with increasing loss rate from left to right

Photo of a flower with increasing loss rate from left to right

File extension : .jpg, .jpeg, .jpe, .jfif
MIME type : image / jpeg
Magic number : FF D8
Developed by: Joint Photographic Experts Group
Type: Lossy graphic format
Standard (s) : ISO / IEC 10918, ITU-T T.81, ITU-T T.83, ITU-T T.84, ITU-T T.86
Website :

Photo of a flower with increasing loss rate from left to right

The JPEG File Interchange Format (JFIF) is a graphic format developed by Eric Hamilton in 1991 for storing images that have been compressed according to the JPEG standard. The filename extension usually used is jpg, less often jpeg, jpe or jfif . JFIF is the most widely used graphics format for photos on the World Wide Web .

The JPEG standard only defines the compression process, but not how the resulting image data must be stored so that they can be exchanged between different computer programs . For example, JPEG does not specify which color space to use. JFIF is a method of storing JPEG data; other options are the Still Picture Interchange File Format (SPIFF) published by the Joint Photographic Experts Group and JPEG Network Graphics . More commonly, a “JPEG file” means a JFIF file.

JFIF only makes use of a small part of the possibilities offered by JPEG: for example, only YCbCr is permitted as a color model and no longer RGB ; only Huffman coding is allowed for entropy coding . There are also some mechanisms for synchronization and resynchronization in the event of transmission errors.

File format

JFIF limits the size of JPEG images to 65,535 × 65,535 pixels.

JFIF image files are preceded by an SOI marker FF D8. These markers JFIF tag follows: FF E0 00 10 4A 46 49 46 00. The sequence 4A 46 49 46is the ASCII representation of "JFIF". Common image programs can also process files without a JFIF tag.

The JFIF files are divided into segments ( called tags in TIFF ). The segments are generally structured in the following form: A introduces the day. FF is a hexadecimal value and corresponds to decimal 255. The xx determines the type of tag. 256 * s1 + s2 specifies the length of the segment. Further images can be hidden in the segments, often a small preview image for a quick preview. Individual segments can appear multiple times. FF xx s1 s2

FF xx symbol designation
FF D8 SOI Start of image
FF Cn SOF n Start of Frame Marker, defines the type of compression:
FF C0 SOF 0 Baseline DCT
FF C1 SOF 1 Extended sequential DCT
FF C2 SOF 2 Progressive DCT
FF C3 SOF 3 Lossless (sequential)
FF C4 DHT Definition of the Huffman tables
FF C5 SOF 5 Differential sequential DCT
FF C6 SOF 6 Differential progressive DCT
FF C7 SOF 7 Differential lossless (sequential)
FF C8 JPG reserved for JPEG extensions
FF C9 SOF 9 Extended sequential DCT
FF CA SOF 10 Progressive DCT
FF CB SOF 11 Lossless (sequential)
FF CD SOF 13 Differential sequential DCT
FF CE SOF 14 Differential progressive DCT
FF CF SOF 15 Differential lossless (sequential)
FF CC DAC Definition of the arithmetic coding
FF DB DQT Definition of the quantization tables
FF DD DRI Define restart interval
FF E1 APP1 Exif data
FF EE APP14 Often for copyright entries
FF En APP n n = 2..F general pointer
FF FE COM Comments
FF DA SOS Start of Scan
FF D9 EOI End of image

An example of a copyright tag: FF EE 00 26 'File written by ...'

An example of a comment tag: FF FE s1 s2 'This photo shot is dated ...'

Structure of a JFIF file:

SOI segment FF D8
APP0 segment FF E0 s1 s2 4A 46 49 46 00 v1 v2 ...
... further segments ...
SOS segment FF DA
Data Compressed data
EOI segment FF D9

The length specifications of the segments also contain the space for the length specifications themselves: An empty segment therefore has the length 2, since this corresponds to the length of the components s1 and s2 themselves.

The start-of-scan (SOS) segment (marker FF DA) is immediately followed by the compressed data until the start of the next segment, which is indicated by the next marker. If a FFoccurs within the data , this is 00marked with a following (zero). Other values ​​indicate the appearance of a new segment or marker. Exception: If FFone of the restart markers ( D0 - D7) follows this, the data continues directly behind it:FF DA ... daten ... FF D0 ... daten ...

Since a decoder is only interested in data between a start mark and an end mark, it is also possible to accommodate Exif , IPTC-IIM standard information and even entire XML or other files in the JFIF file using the data container method. However, the extensions are not JFIF-compliant. It is recommended to remove such files before publishing an image if they contain private data.

Exif metadata

Metadata in Exif format can also be saved in image files in JPEG format ; Many digital cameras store information about the manufacturer and software version here. License data can also be saved. The habit of some image recording (e.g. software in digital cameras) and image editing programs to save preview images in the Exif field, which are not necessarily adjusted when the image file is changed, attracted attention ; this means that parts of the image file that are not intended for publication can still be made public in low resolution.


  • Thomas W. Lipp: Graphic formats. Microsoft Press, Unterschleißheim 1997, ISBN 3-86063-391-0 .
  • John Miano: Compressed Image File Formats. Addison-Wesley, Reading 2000, ISBN 0-201-60443-4 .

Web links

Commons : JPEG file format  - collection of images, videos and audio files