Sunteți pe pagina 1din 20

Image Compression

Image Compression GIF compression Principles

The graphics interchange format is used extensively with the


Internet for the representation and compression of graphical images Limited color palette A GIF image can contain 2, 4, 8, 16, 32, 64, 128 or 256 colors
Global Color table:

The table of colors that relate to the whole image.


Local Color table: The table of colors that relate to a portion of the image.

Image Compression GIF


Although colour images comprising 24-bit pixels are supported GIF reduces the number of possible colours that are present by choosing 256 entries from the original set of 224 colours that match closely to the original image Hence instead of sending as 24-bit colour values only 8-bit index to the table entry that contains the closest match to the original is sent. This results in a 3:1 compression ratio The contents of the table are sent in addition to the screen size and aspect ratio information

The image can also be transferred over the network using the interlaced mode

Image Compression GIF Compression

Image Compression GIF interlaced mode

1/8 and 1/8 of the total compressed image


GIF also allows an image to be stored and subsequently transferred over the network in an interlaced mode; useful over either low bit rate channels or the Internet which provides a variable transmission rate

Image Compression GIF interlaced mode


Further and remaining of the image

The compression image data is organized so that the decompressed image is built up in a progressive way as the data arrives

It supports pixel resolution of up to 48 bits- 16 bits each for R, G, B

Digitized Documents
Since FAX machines are used with public carrier networks,
the ITU-T has produced standards relating to them These are T2(Group1), T3 (Group2), T4 (Group3) (PSTN), and T6 (Group 4) (ISDN) The resulting codewords are grouped into terminationcodes table (white or black run-lengths from 0 to 63 pels in steps of 1) and the make-up codes table (contains in multiples of 64 pels) It is technique called as overscanning.-receiver ensures that codeword always relates to white pels and then B/W.

Since this codeword uses two sets of codeword it is known as the modified Huffman codes

Image Compression GIF interlaced mode


ITU T Group 3 and 4 facsimile conversion codes: termination-codes

Termination code table

Image Compression GIF interlaced mode


ITU T Group 3 and 4 facsimile conversion codes: make-up codes Make-up of 64 codewords

Each scanned line is terminated with an EOL code. In this way the receiver fails to decode a word it starts to search for an EOL pattern If it fails to decode an EOL after a preset number of lines it aborts the reception process and informs the sending machine A single EOL precedes the end of each scanned line and six consecutive EOLs indicate the end of each page The T4 coding is known as one-dimensional coding because each scanned line is encoded independently.

Drawbacks
Each scanned line is encoded independently , the T4

coding scheme is one dimensional coding scheme. Documents containing photographic images are represented by varying densities of white and black pels. Results in large number of very short or white runlengths which lead to negative compression ratio.

T6 Coding Scheme
Additional tag bit is added with EOL
If it is 1 then next line is coded with T4 coding scheme If it is 0 then then T6 coding scheme is used. This is known as modified modified READ coding. This is two dimensional coding since it identifies black

and white run-lengths by comparing adjacent scan lines. And modified version of previous one.

MMR coding (2 dimensional coding)


The modified-modified relative element address designate coding explores the fact that most scanned lines differ from the previous line by only a few pels E.g. if a line contains a black-run then the next line will normally contain the same run pels plus or minus 3 pels In MMR the run-lengths associated with a line are identified by comparing the line contents, known as the coding line (CL), relative to the immediately preceding line known as the reference line (RL)

MMR coding (2 dimensional coding)


Assume the first reference line to be an (imaginary) all white line and the first line proper is encoded relative to this. The encoded line then become the reference line for the following line , and so on. The run lengths associated with a coding line are classified into three groups relative to the reference line

MMR coding (2 dimensional coding)


The READ algorithm starts by identifying five pixel locations in the previous and current lines:

MMR coding (2 dimensional coding)

a0: the last pixel value known to both the encoder and
decoder; a1: the transition pixel to the right of a0; a2: the second transition pixel to the right of a0; b1: the first transition pixel whose color is opposite to a0 in the previously coded line; and b2: the first transition pixel to the right of b1 on the previously coded line.

Image Compression run-length possibilities: pass mode (a), vertical mode


Pass mode

This is the case when the run-length in the reference line(b1b2) is to the left of the next run-length in the coding line (a1a2), that is b2 is to the left of a1then run length b1b2 is encoded using the codewords.

Image Compression run-length possibilities: pass mode (a), vertical mode


Vertical mode

This is the case when the run-length in the reference line (b1b2) overlaps the next run-length in the coding line(a1a2) by a maximum of plus or minus 3 pels in this just difference a1b1 is coded.

Image Compression run-length possibilities: Horizontal mode

This is the case when the run-length in the reference line (b1b2) overlaps the run-length (a1a2) by more than plus or minus 3 pels then run-length a0a1 and a1a2 are coded.

S-ar putea să vă placă și