Compressione RLE A compressão RLE RLE-Komprimierung Compression RLE La compresión RLE

Pixel packing

Pixel packing is a method which allows pixels to be stored in an optimal way: for a monochrome image there are, by definition, only two colours, a point of the image can thus be coded in only one bit to gain memory space.

RLE Compression

The RLE compression method (Run Length Encoding, sometimes written as RLC for Run Length Coding) is used by many image formats (BMP, PCX, TIFF). It is based on the repetition of consecutive elements.

The basic principle consists in coding a first element by giving the number of repetitions of a value and then the value to be repeated. Thus, according to this principle, chain “AAAAAHHHHHHHHHHHHHH” when compressed yields “5A14H”. The compression gain is thus (19-5) /19, that is, approximately 73.7% On the other hand, for the chain “CORRECTLY”, where there is little character repetition, the result of the compression is “1C1O2R1E1C1T1L1Y”, thus compression proves to be very expensive here, with a negative compression gain of (9-16)/9 that is, -78%!

Actually, RLE compression is governed by particular rules which allow compression to be carried out when necessary and the chain to be left as it is when compression causes a waste. These rules are the following:

  • If three or more elements are repeated consecutively, the RLE compression method is used
  • If not, a control character (00) is inserted, followed by the number of elements of the non-compressed chain and then the latter
  • • If the number of elements of the chain is odd, the control character (00) is added on the end
  • • Finally, specific control characters were defined in order to code:
    • an end of line (00 01)
    • the end of the image (00 00)
    • a pointer displacement over the image of XX columns and YY rows in the reading direction (00 02 XX YY).

Thus, RLE compression makes no sense except for data with many consecutive repeated elements, in particular images with large uniform areas. This method however has the advantage of not being very difficult to implement. There are alternatives in which the image is encoded by blocks of pixels, in rows, or even in zigzag.

RLE Compression

Last update on Thursday October 16, 2008 02:43:16 PM.This document entitled « RLE Compression  » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Best answers for « RLE Compression » in :
JPEG compression Show JPEG compression The acronym JPEG (Joint Photographic Expert Group comes from the meeting held in 1982 of a group of photographic experts, whose main concern was to work on the ways to transmit information (still or animated images). In 1986, the...
LZW Compression Show LZW compression Abraham Lempel and Jakob Ziv are the creators of the LZ77 compressor, invented in 1977 (hence its name). This compressor was then used for filing (ZIP, ARJ and LHA formats use it). In 1978 they created the LZ78 compressor...
Download PlexCrypt Compression-Encryption Show Description The application is designed by PlexObject Solutions, Inc. Awarded from some most popular places for its perfection; PlexCrypt Compression-Encryption is a tool that allows you to compress files and folders which is in a zip file. The...
Compress your pages in Gzip ShowCompress your pages in Gzip Compressing web pages on the fly Test the Gzip compression One of the main qualities of a website is fast loading. But it depends on the size of Web pages and their components. There are a number of...
Create and Open a RAR file ShowCreate and Open a RAR file *How to create a RAR file *How to open a RAR file RAR is an archive file format that is used during data compression, error recovery and file spanning. RAR is the acronym for Roshal Archive, inspired by...
What is an MKV file and how to read it ShowWhat is an MKV file and how to read it What is an MKV file? An MKV file is an audio and video container that can support various audio, video and subtitle compression formats. MKV files usually have a menu system slightly similar to a DVD menu,...
Download XviD codec ShowIt is an open source which focuses on the compression of video. Xvid video codec allows the compression and the decompression of digital videos with the aim of reducing the bandwidth during the transmission through a network. Xvid is specialized in...
Video compression (codecs) ShowThe concept of codec A non-compressed video image occupies approximately 1 MB. In order to obtain a fluid video, it is necessary to have a frequency of at least 25 or 30 images per second, which produces a data flow of approximately 30 MB/s, that...
Data compression ShowWhy compress data? Nowadays, the computing power of processors increases more quickly than storage capacities, and is much faster than network band-widths, because this requires enormous changes in the telecommunication infrastructures. Thus, to...
DTS (Digital Theater Sound) ShowDTS standard DTS (Digital Theater Sound) is a digital sound coding standard created by Universal. Compared with the Dolby Digital standard, DTS uses four times less compression and digitises sound at 20 bits instead of 16. Therefore, DTS's sound...