Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > General
User Name
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!


  Search this Thread
Old 01-01-2007, 11:42 AM   #1
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Rep: Reputation: 30
lzw example on binary data resources

i have found plenty of examples for how LZW works on String input, but none for how it works on binary data. Can anyone post any links?

Old 01-01-2007, 12:33 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,571

Rep: Reputation: 180Reputation: 180
It's more or less the same, depending on the data internal structure. An implementation working on string also works for any other file content. GIF format is an example of LZW usage for binary data.
Old 01-01-2007, 07:53 PM   #3
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,515
Blog Entries: 4

Rep: Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955
Algorithms such as LZW neither know nor care what the data to be compressed "means to you." (Computers can't read.)

It is a provable fact, of course, that text is much more compressible than binary data simply because text has much more redundancy (at the bitwise level). A typical file of English text, for instance, uses only a fraction (26+26+20 or so) of the 256 possible values of "a byte," which realistically means that only 6/8'ths of the bandwidth is being used under worst-case conditions. With binary data, the probability is much greater that most of the 256 possible values are being used. That is to say, within any given block of (say) 4096*8 bits, there aren't too many usefully-repeated groups of bits.

File-compression basically works by identifying repeated groups of bits, within a window of data of some length, and replacing them with a single (bitwise) code...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing binary data in MySQL take 2 drspin Programming 5 05-05-2006 03:26 PM
Sockets and Binary data oulevon Programming 3 04-06-2006 04:35 AM
writing binary data via the shell? zero79 Programming 3 03-04-2006 11:35 AM
Python DCOP (KDE) and binary data carl.waldbieser Programming 0 12-22-2005 03:02 PM
recording raw binary data as an MP3 uman Linux - General 1 02-19-2005 09:07 PM > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 10:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration