Disk imaging program?

Liam Proven lproven at gmail.com
Thu Jun 26 10:18:36 UTC 2014


On 25 June 2014 19:03, Nils Kassube <kassube at gmx.net> wrote:
> All of the standard compression programs (gzip, bzip2, xz, ...) only use
> lossles compression. Lossy compression is only used for images, audio or
> video. For "normal" files the compression program can't decide if /
> which bits are not needed and may be left away.


Lossy compression is not the same as compression loss.

Lossy compression is used for human-readable media files: images,
sound, video, where a viewer/listener can tolerate a reduction in
fidelity for much smaller file-sizes.

Compression loss is the difference in size of compressed files when
compressed with different algorithms: zip, lzw, bz2, rar, 7zip, etc.
Different algorithms cope differently with different /types/ of file -
some are good on source code, some on text, some on executables, some
on sound samples, etc. Smart compression tools like PKZip contain
multiple algorithms and examine each file as it comes up for
compression and pick the best algorithm; this is shown by messages
saying "deflating", or "crunching", or "squeezing" etc. - different
word, different algorithm.

But all these are lossless algorithms, because machine-readable files
like binaries must be identical when decompressed.

Why not always use the algorithm that produces the smallest file,
then? Because the greater the size reduction, the longer it takes.
Some algorithms produce acceptable (if not very efficient) compression
very fast (e.g. RLE, good for monochrome images with low levels of
detail & the only one I have actually implemented personally - it's
*very* simple). Some produce tiny files with almost no redundancy but
are very slow. Some need the whole file as input and produce a whole
file as output as they read and write multiple parts; some can just
work on the fly and don't need access to the end of the file, such as
Huffman coding, which is obviously what you need for streaming
compression/decompression.

If you want to know about how some routines compress smaller than
others, you need to read up on Claud Shannon, Information Theory,
Gödel limits and so on -- it gets complex.


-- 
Liam Proven * Profile: http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk * GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at hotmail.com * Skype/AIM/Yahoo/LinkedIn: liamproven
Cell: +44 7939-087884




More information about the ubuntu-users mailing list