Help answer threads with 0 replies.
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, 12:42 PM   #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, 01:33 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,547

Rep: Reputation: 160Reputation: 160
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, 08:53 PM   #3
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,979

Rep: Reputation: 1441Reputation: 1441Reputation: 1441Reputation: 1441Reputation: 1441Reputation: 1441Reputation: 1441Reputation: 1441Reputation: 1441Reputation: 1441
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 04:26 PM
Sockets and Binary data oulevon Programming 3 04-06-2006 05:35 AM
writing binary data via the shell? zero79 Programming 3 03-04-2006 12:35 PM
Python DCOP (KDE) and binary data carl.waldbieser Programming 0 12-22-2005 04:02 PM
recording raw binary data as an MP3 uman Linux - General 1 02-19-2005 10:07 PM

All times are GMT -5. The time now is 09:19 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