View Single Post
Old 02-26-2004, 03:38 PM   #5
Adrian
Eskimo Regular
 
Join Date: Feb 2004
Location: Ireland
Posts: 103
Default



They work kinda like this afik,


if you can imagine < kinda a tough one to explain > hmm If you can imagine a Picture of some lovely scenic scene or something to that effect , now thats what you see , ok.


But when the computer looks at it, all it see's is that the picture only uses 5 different colours. So it makes A=Blue , B=Black, C=white etc now it can strip the picture of colour and insert the different letters instead of the colours.


So effectively it now see's AAAACCBBBEEBEDDBDBEBEBDBBEBSBBSBBEBBBSBBDCCCDEDDEE DEDDE


Now what it does is look for paterns in the page for instance, looking at the line I wrote I see the first 4 letters are all A's , so now Ill make the combination of 4 A's in a row =@ <or any other random symbol> looking further along 2 C's in a row, ill make this into # and it continues doing this down the picture


So effectively it will a have a table of values for every combination on the picture, now that might sound more complicated, just looking at the one line of code that i wrote, but if you can imagine 1000000000 pages of it, you will get a picture of how it can save you time


So anyway it builds its table and then it compress's the picture using clever algorithms < that im not going to get into!> so it knows that when you uncompress the picture , it knows where to replace all the differnt elements back to their correct location, so what you see again is the beautifull picture.


That is also why text and will convert alot more that pictures because in text its only black and white , while a picture could have millions of different shades.


And that is a very tired mans explaination of how Zips / compression works.
Adrian is offline   Reply With Quote