settings
skip menu
change media type
xhtml+xml
change language
deutsch
scripting

URI: http://www.j-a-b.net/web/graf/graf-jpg
last updated: 2009-12-04
© 2002-2009 Contact

up down
Subject Index

The JPG File Format

The JPG - also known as JPEG - file format was developed by the Joint Photographic Experts Group. Actually, this is not a file format but a streaming format. The graphic's file format behind a JPG file is the JFIF file format.

JFIF is a raster graphic with a colour depth of 24bit (8bit allocated for each of Red, Green, and Blue) corresponding to 224 = 16,777,216 colours. Transparency and animation are not possible for JPEG/JFIF graphics. The outstanding feature of JPEG/JFIF is its compression method. By the way, the compression is the biggest disadvantage of this file format as well. In a minute we will see why this is the case.

An uncompressed raster graphic like the BMP file format stores information about position and colour for every single pixel. When being transformed to the JPEG/JFIF file format, similar colour values of adjacent pixels are equalised and information about the area where the resulting colour resides inside the image, is stored. This process is called colour quantisation. During this process, information about the original colours of the image is irrevocably lost. There are other processes involved in compressing JPEG/JFIF files, but colour quantisation accounts both for the main reduction in file size and loss of information. The compression rate can be varied, the bigger the compression, the more thoroughly the quantisation process is performed.

When being rendered, the colour value of each pixel has to be recalculated. As we have seen before, the original information is lost, so "approximate" values are taken instead. For such image motifs having rich colour gradients and soft edges, as photographs usually have, this method works perfectly. The human eye can hardly distinguish the original from the compressed file. But when the original motif contained large unicoloured areas or sharp edges, rendering will lead to blurred edges, noise pixels and other artifacts reducing the image quality considerably. Have a look at the ① following images to understand how this compression works.

To summarize, the JPG file format is the preferred format for photographs but should be avoided for sharp-edged illustrations and design elements. A quick overview and summary of JPG's properties can be found at: Graphic's Files Formats - A Comparison.

Subject Index

CC logo
This page is licensed under a Creative Commons License.