Please enable JavaScript.
Coggle requires JavaScript to display documents.
Compression (Types of compression suited to different scenarios (Graphics,…
Compression
Types of compression suited to different scenarios
Sound
Perceptual Coding
Perceptual coding is a lossy compression technique applied to
sound. MP3 sound files make use of perceptual coding.
Algorithms are used to remove some data from sound files
which focus on removing sound captured at frequencies out
with the dynamic range of human hearing and to remove
frequencies which cannot be picked up by the human ear.
Free Lossless Audio Codec
This is lossless compression technique applied to sound files that are saved as .flac files. FLAC is open source which means users can access the code to achieve compression. It compresses sound files by trying to predict the frequency of future samples and then trying to balance the difference between what was predicted and what was actually sampled.
Video
Animated GIFs
LZW compression is commonly used for animated GIF files
AVI
This file format supports a maximum frame rate of 30 frames per
second and a resolution of 320 * 240 pixels per frame. AVI files do not have built in compression.
MPEG
This file format stores a few key frames as
compressed JPEGs. Subsequent frames after a key frame are
compared to the key frame, and only the changes are saved.
Graphics
Gif
GIF uses LZW lossless compression. Each pixel is represented in 8 bits which allows
for 256 colours. GIFs have a transparency feature where a specific colour can be
made transparent so that parts of an image do not obscure the one behind.
Bitmap
24-bit bitmap graphics give true colour with 224 colours but are heavy on storage
requirements. RLE and LZW can be used to reduce the file size.
Jpeg
This file format uses lossy compression. The loss in the detail can range from
barely noticeable to seriously reducing the quality of the image.
PNG
This is a lossless file format intended to replace GIF by adding extra features. The
PNG file format has a higher compression factor than GIF files and also has the
transparency feature.
Difference between lossy and lossless compression
Lossy compression removes data. The removed data cannot be restored
Lossless compression does not remove data. It codes the data in such a way that it can be uncompressed.
Situations in which lossy or lossless compression would be used
Lossy
Lossy compression works well on photographic images where
there are not likely to be solid colours. Simple graphics and
logos would benefit from lossless compression.
Lossless
Lossless compression works well when there are large blocks of repeating pixels
Why compression is required
Compression is required because uncompressed files can be too large for everyday use on a regular computer
For example, HD movies
have a resolution of 1920 by 1080 pixels, using 24 bits per pixel
for colour and a frame rate of 50fps. This means:
1920 x 1080 x 24 x 50 bits per second
= 2488320000 bits per second
= 2.3 Gbps
2.3 gigabytes per second is too demanding for a movie