Data Compression


Criteria

Survey Formats

Basics

Compression Methods

Data Formats

Files

Audio Data

Image Data

GIF

Colours

Data Compression

Characteristics

GIF87a

GIF89a

Patents

Optimizations

Colour Tables

Optimized Tables

Standard Tables

Raster

Anti-Aliasing

Examples

Drawings

JPEG

Video Data


Glossary

Index


Download


www.BinaryEssence.com

GIF - Colour Tables


The access to colour information is made by RGB colour tables. These consist of a list describing for each index the composition of the colour in the RGB format.


Example: Structure of a GIF colour table


Index Red Green Blue
0. 255 000 000
1. 000 255 000
... ... ... ...
255. 255 255 255

In the above example 8 bits per colour component are used (range of values: 0 to 255), i.e. 3 byte are necessary per index. Each table of 256 colours require 768 Byte in total. The lower effort for addressing however is more essential than the reduction of the colour table. A graphic file with two colours require only one bit to address the colour index, 8 bits are necessary addressing 256 colours.


Number of Colours Adressing Size of the Table Coding 100 x 100 Pixel (uncompressed)
2 1 bit 6 byte 1,250 byte
4 2 bit 12 byte 2,500 byte
8 3 bit 24 byte 3,750 byte
16 4 bit 48 byte 5,000 byte
32 5 bit 96 byte 6,250 byte
64 6 bit 192 byte 7,500 byte
128 7 bit 384 byte 8,750 byte
256 8 bit 768 byte 10,000 byte

The required data volume shall serve only as an example to give an impression about the dimension. In a real GIF file the contents will become compressed. The differences of the real file sizes are usually smaller.


The examples shall demonstrate that colours reduction is worthwhile. The gain results directly in shorter waiting times and improved acceptance.


 <   ^   > 

GIF - Optimizations GIF - Optimizations GIF - Optimized Colour Tables