compression Flashcards
AS-level
why do we need to compress a file
– the data files are very large
–it would take a long time to send the non compressed file//compressed files will download faster
–a higher bandwidth would be needed to transmit the uncompressed file
what are the two types of compressions and define them
lossless file compression– in this technique the data is not lost ,and the compressed file can be decompressed as the original
lossy file compression– in this technique the data is lost and the decompressed file is not same as the original
application of lossy and lossless
lossy: accuracy of data is not important
smaller file size needed =>lossy reduces file size more than lossless
lossless: accuracy of data is important
abdullah wants to compress the source code, identify the most appropriate compression technique he should use.
lossless:-
– in this technique data is not lost
–any lost data will mean that program will not work
photograph is to be emailed to a friend .
lossy:-
– all the data is not required
–the number of colors can be reduced without the user noticing
–email requires a significantly smaller file size
–takes a shorter time to transmit
OR
lossless:-
–a high quality image may be needed.
–all of the data is needed and cannot afford to lose any data
how an bitmap image can be compressed
RLE(run length encoding) is lossless compression
–looks for runs of consecutive pixel of the same color
– store the color value once and the number ,of times it occurs
– lossless method of compression
–reference to the given image