Graphics File Formats in Computer Graphics
JPG format
The format known as JPG or JPEG is actually a 1992 published standard (ISO/IEC 10918- 1), which describes different methods for image compression. Since the standard itself does not contain any provisions on how the image should be saved, an additional format is necessary, with the JPEG File Interchange Format (JFIF) established as a cross-browser standard. Alternatives that are rarely used are the Still Picture Interchange File Format (SPIFF) and the JPEG Network Graphics (JNG) graphic file format.
Compressing JPG format changes the usual structure of pixel graphics by combining 8 x 8 pixels into one block and converting them into a single layer. For example, a color conversion between the RGB colorspace, YCbCrcolor model, and a low-pass filter (where high frequencies are filtered out in order to reduce the file size). Depending on the chosen compression level, this process is associated with a certain loss of quality since not all image information is retained.
Recommended application scenario: Storage and publication of photos
PNG format
PNG (Portable Network Graphics), a universally recognized graphic file format developed by the World Wide Web Consortium (W3C), appeared for the first time in 1996. As a patent-free and modern alternative to GIF (Graphic Interchange Format), it is characterized by the possibility of lossless compression as well as a maximum color depth of up to 24 bits per pixel (16.7 million colors) – or as many as 32 bits with alpha channel. In contrast to GIF, however, animations can’t be generated with PNG.
The PNG format supports both transparency and semi-transparency (thanks to the integrated alpha channel), which makes it suitable for all types of images, as well as interlacing, allowing for an accelerated build-up of the image file during the loading process.
The color and brightness correction mechanisms ensure that PNG image files look the same on different systems. In order to compress a graphic in PNG format, you can use tools such as the pngcrush. Due to the loss-free compression process, the files are still comparatively large, which is why the format is less suitable for displaying photographs than JPG, for example. It also offers the possibility of reducing the color space (to 1 to 32 bits per pixel).
Recommended application scenario:
storing and publishing small images and graphics (logos, icons, bar charts, etc.), graphics with transparency, loss-free photos.
GIF format
The online portal, CompuServe, introduced the Graphics Interchange Format, GIF for short, in 1987 as a color alternative to X BitMap (XBM)’s black and white format. In contrast to other solutions such as PCX or MacPaint, the GIF files needed significantly less space thanks to the efficient LZW compression (data compression with the Lempel-Ziv-Welch algorithm), which made the format very popular when the internet first took shape. As a format for photos and graphics, JPG and PNG are now clearly ahead but since version GIF89a (1989), the format has been able to combine several individual images in a single file, which is why it is still used to create small animations.
All color information is stored in GIF in a table, the color palette. The table can contain up to 256 colors (8 bit), which is why the image format is not suitable for displaying photographs. The information can also be defined as transparent – however, unlike the more modern PNG, partial transparency is not possible, meaning that a pixel can be either visible or invisible.
Recommended application scenario:
Creating animations; clip art, logos, essentially things where a low color depth isn’t problematic.
TIFF format
TIFF (Tagged Image File Format) is a graphic file format that is especially used for transmitting print data and high-resolution images. It was developed as early on as 1986 by Microsoft in cooperation with Aldus (now belongs to Adobe) and is specially optimized for embedding color separation and color profiles (ICC profiles) of scanned images. Furthermore, TIFF supports the CMYK color model and allows a color depth of up to 16 bits for each color channel (the total color depth is 48 bits). Since 1992, the format has been able to be compressed loss free using LZW compressions, which is also used in GIF format.
Thanks to these features, TIFF has become the standard for images where quality plays a more important role than file size. This is how publishers and print media work with the image format. The archiving of monochrome graphics e.g. technical drawings, counts as one of the most versatile applications. Geo TIFF was established with additional tags for saving and presenting raster-based Geo-information (maps, aerial images, etc.)
Recommended application scenario: transferring high-quality images with high resolution for printing
BMP format
BMP (Windows Bitmap) was developed for Microsoft and IBM operating systems and was first released in 1990 with Windows 3.0 as a memory format for pixel graphics with a color depth of up to 24 bits per pixel. The uncompressed image format assigns exactly one color value to each pixel, which is why BMP files are very large by default. For this reason, the format is not suitable for use on the web.
Recommended application scenario: Saving photos/graphics for offline use.