3.4.8.+Need+for+Speed+in+Data+Transmission

=__**The need for speed in data transmission**__= Since there is no unlimited bandwidth available in most cases and networks can be congested, it is important to transmit data as fast and efficiently as possible. This can be achieved by compressing the data, i.e. reducing the size of the file, since the smaller the file, the faster it can be transmitted.

**Text compression** LZW compression:
 * This method of compression works by assigning certain codes to combinations of letters. That means, certain combinations of letters (several bytes) are replaced by a certain 12-bit code.
 * If you need more information on LZW compression, click here, for example: [|http://en.wikipedia.org/wiki/Lempel–Ziv–Welch]

**Images** __Bitmaps (bmp)__ - Every pixel's color value is stored separately. This ensures lossless storage of the images but also means larger file sizes. __ JPEG - lossy compression (compression of bitmaps): __ __GIF - lossless compression__:
 * Similar colors are stored as one 'average' color. If a sky-image has a lot of very similar blues, for example, these similar blues might be stored as one blue when compressed with this type of compression. However, since not all different colors are stored, this type of compression is lossy.
 * Only colors that are exactly the same are stored as one block. If 10 pixels next to each other are exactly the same green tone, for example, then those are stored as one block. However, if the color only varies slightly, it is stored as separate block. This means that there is no loss in data and image quality but also that the file size is larger.
 * This type of compression clearly doesn't work very well with photographs or oil paintings, as they are very complex and don't contain large areas with exactly the same color. Therefor the compression won't be very high. This type of compression works better for ex. cartoon images, where the same color covers fairly large areas of the image.

__Vector graphics__ Different than the image formats described previously, in vector graphics the pixels themselves aren't stored. The lines and shapes in the images are stored as mathematical equations and with other attributes, such as color, fill, pattern, style, etc. This means one can enlarge the image as much as one wishes to without any loss of image quality. However, the disadvantage is that it is not possible to use vector graphics for complex images such as photographs.

Here an image showing the difference between vector graphics and the usual image formats such as bitmaps, jpegs and gifs:

Links
 * 3.2.2 Bits n Bytes
 * 3.5.1 Binary Data Representation

__ Some other interesting links: __
 * @http://www.howstuffworks.com/file-compression.htm
 * @http://en.wikipedia.org/wiki/Data_compression

Written by: Jocbe Last update: 17th May 2012

Sources:
 * Jones, Richard. Computer Science Java Enabled. Victoria: IBID Press, 2004.
 * "Lempel–Ziv–Welch." Wikipedia, the Free Encyclopedia. 31 Jan. 2011. Web. 01 Feb. 2011. <[|http://en.wikipedia.org/wiki/Lempel–Ziv–Welch]>.
 * Yug. "File:Bitmap VS SVG.svg." Wikimedia Commons. 2 Oct. 2006. Web. 03 Feb. 2011. .