A compression tutorial

Have you ever wondered how big things get sent across the internet so quickly?  I think that we all know that the answer is “compression”.  But, how does this compression work?  Does anyone remember the compression wars between ARC and ZIP?

Learning how is the goal in this tutorial from Code.org.

Make sure that you watch the video first to get the most from the experience.  You’ll see the rationalization for why compression is used along with some real life examples.

The two big terms to learn and understand are “lossy” and “lossless”.  Do you know the difference?

Then, it’s off to the tutorial.  It’s an interesting and interactive concept.  You’re presented with some original text.

Now, the idea is to compress this information, starting at 240 bytes, by looking for patterns that could be repeated.  The patterns are replaced by symbols and you create a dictionary of the symbols.  That’s important because compression without a way to later decompress it is, well, pretty useless.

So, go looking for the patterns and the widget does the character substitution for you.

With these three substitutions, I was able to compress things by 33.75%.  If this text was to be sent, my 240 bytes is now 159.

The more compression, the better the speed.  Even after doing these screen grabs, I can see more ways to compress.

Sounds like a Computer Science classroom competition to me!

One thought on “A compression tutorial

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s