Sie sind auf Seite 1von 8

RUN-LENGTH CODING

INTRODUCTION:
Images with repeating intensities along their rows(columns) can be compressed by representing runs of identical intensities as run-length pairs. Each run-length pair specifies the start of a new intensity & the number of consecutive pixels that have this intensity. This technique referred as run-length encoding(RLE)-> 1950s,along with 2-D extensions: standard compression approach in fascimile (FAX)coding.

BMP file format : 2 different modes: encoded and absolute. Encoded mode:2 byte RLE representation First byte: number of consecutive pixels that have the color index contained in the second byte Second byte:8 bit color index selects the runs intensity(color or gray value)from a table of 256 possible intensities. Absolute mode: First byte is 0 Second byte: 0->end of line 1->end of image 2->move to a new position 3-255->specifies pixels individually

Particularly effective when compressing binary images->only 2 possible intensities(black &white, adjacent pixels more likely to be identical. Basic idea is to code runs of 0s and 1s encountered in a left to right scan of a row by its length and to establish a convention for determining the value of the run. The most common conventions are 1)To specify the value of the first run of each row 2)To assume that each row begins with a white run, whose length may be 0. Additional compression can be achieved by variable-length coding the runlengths themselves.Here the black and white run lengths are specifically tailored.An estimate of black run-lenth denoted H0 and entropy for white runs H1..The approximate run-length entropy of the image can be found out.

2 of the oldest and most widely used image compression standards are the CCITT Group 3 and 4 standards for binary image compression. Orginally designed for as FAX coding methods for transmitting documents over telephone networks Group 3 standard uses a 1-D run-length coding technique in which the last k-1 lines of each group of k lines can be optionally coded in a 2-D manner. Group 4 standard ->sim plified version of Group 3 standard in which only 2-D coding is allowed

ONE DIMENSIONAL CCITT COMPRESSION Each line of an image is encoded as a series of variable-length Huffman code words that represent the alternating white and black runs in a ieft-to-right scan of the line. Compression method employed is referred as Modified Huffman(MH) coding. Code words are of two types: Terminating codes Makeup codes

If run length r<63:terminating code used to represent it If r>63,2 codes are used: Makeup code for quotient,and terminating code for remainder r mod64. If r/64<1792,separate black and white makeup codes are specified The standard requires that each of the line begin with a white run length code word ,which in fact may be00110101,codefor a white run of length zero. A unique EOL(end-of-line)code word 0000000000001 is used to terminate each line as well as to signal the first line of each new image. End of a sequence of images is indicated by six consecutive EOLs.

THANK YOU