MULTIMEDIA TECHNOLOGIES LECTURE 03 IMAGE FORMATS

IMRAN IHSAN ASSISTANT PROFESSOR IMAGE FORMATS

• To store an image, the image is represented in a two‐dimensional matrix of pixels.

• Information about each pixel has to be stored.

• Additional information may be associated to the image as a whole, such as height and width, depth.

• The most popular image storing formats include PostScript, GIF (Graphics

• Interchange Format), JPEG, PNG, TIFF (Tagged Image File Format), BMP (Bitmap), etc.

2 GIF GRAPHIC INTERCHANGE FORMAT

• GIF stands for Graphic Interchange Format • GIF87a • first format of GIF used on the Web was called, representing its year and version. • saves images at 8 pits‐per‐pixel (256 colors) by using a color loop up table (color palette). • lossless file compression format (i.e. all image information retained). • GIF89a • format updated in 1989 to include transparency, interlacing and animation. • GIF89a – Transparency • Transparency allows for the specification of one of the colors in the palette to be ignored while processing the image for your display device.

Without Transparency With Transparency

3 GIF GRAPHIC INTERCHANGE FORMAT

• General file format of a GIF87 standard file • Screen Descriptor comprises a set of attributes that belong to every image in the file.

4 GIF GRAPHIC INTERCHANGE FORMAT

• Color Map is set up in a very simple fashion as in Fig. However, the actual length of the table equals 2(pixel+1) as given in the Screen Descriptor.

5 GIF GRAPHIC INTERCHANGE FORMAT

• Each image in the file has its own Image Descriptor

6 GIF89A INTERLACING

• Interlacing ‐ lines are stored in an unusual order: • the first pass has pixel rows 1, 9, 17, etc (every eighth row); • the second pass has rows 5, 13, 21, etc (every remaining fourth row); • the third pass has rows 3, 7, 11, 15, etc (every remaining odd row); • and the last pass has rows 2, 4, 6, etc (all the even‐numbered rows). • allows the user to get a good idea what is coming up, so they don't have to wait until the whole image is downloaded • images don't really load any faster, they just seem to. Pass 1 Pass 2 Pass 3 Pass 4

7 GIF89A INTERLACING

• If the “interlace” bit is set in the local Image Descriptor, then the rows of the image are displayed in a four‐pass sequence

8 GIF89A ANIMATION

• Animation ‐ GIF89a • specification added a few enhancements to the GIF file header which allows browsers to display multiple GIF images in a timed and/or looped sequence.

9 JPEG, JPG JOINT PHOTOGRAPHIC EXPERTS GROUP

• JPEG stands for Joint Photographic Experts Group. • Saves image in 24‐bit color, images can have 16,777,216 colors • Best for photo‐quality images • No animation • No transparency • Lossy image compression format • Progressive JPEG • Similar to interlaced GIF • Image is transmitted and displayed in a sequence of overlays, with each overlay becoming progressively higher in quality.

10 JPEG 2000

• Designed to overcome the limitations of the original JPEG standard and provide high‐quality images at low bit‐rates.

• Advantages Over JPEG • Better image quality at the same file size • Good image quality even at very high compression ratios, over 80:1 • Large Images: JPEG is restricted to 64kx64k images. JPEG2000 will handle image sizes up to (232 ‐ 1) • Support both lossless and lossy compression • Handle up to 256 channels of information • Improved error resilience • Compound document – can include non‐image data as part of the file

11 JPEG 2000

ORIGINAL IMAGE JPEG2000 (1:20) JPEG (1:20)

12 JPEG

• Compression Ratio => 345:1 (top row), 195:1 (bottom row)

Original Image (600x480x24)

JPEG (3 KB, 2441 bytes) JPEG2000 (3 KB, 2483 bytes)

BMP (844 KB)

JPEG (5 KB, 4370 bytes) JPEG2000 (5 KB, 4261 bytes) 13 PNG PORTABLE NETWORK GRAPHIC

• Stands for Portable Network Graphic. • Designed to replace GIF.

• Features: • Lossless compression • Support for up to 48‐bit color information • Varying levels of transparency • Gamma correction • Better compression, 10‐30 percent smaller files than GIF • Interlacing • Patent‐free compression algorithm

14 PNG ALPHA VALUES

15